Upgrading from Qt 4.2.1 to Qt 4.6.1 changed the fonts
Just switched from Qt 4.2.1 to 4.6.1 and the fo开发者_如何学Gonts are different. Different font type and size (bigger).
I did not regenerate any files just tried compiling with a different Qt version.
All the settings for the fonts, etc. are in the .cpp files.
Any ideas on how to change the fonts back?
I inherited the code and I'm not a Qt developer, if anyone can point me to some resources on this problem that would be great as well.
I suspect that this might just be the danger of coding styles like fonts in source code rather than using style sheets. When things change you'll need to add more source code but with style sheets any new stuff should get automatically covered by them provided they are applied on a wide enough scope. Only a guess though.
If your application is using a consistent font and font size throughout then a quick fix which might work is to try setting up an application-wide style sheet and setting it with QApplication::setStyleSheet. For example,
qApp->setStyleSheet( "*{ font-family: \"Times\"; font-size: 12pt }" );
精彩评论