Using Qt Designer for the creation of ui-files, the following problem occurred:
Opening the same ui-file on a different Linux system results in different displaying of the font sizes. So, the ui-files created on one system may have too large fonts, when opening them with Qt Designer on another system. This makes text unreadable in many cases. The "point size" of the widgets is the same on both systems, but in order to make it readable on both, I have to manually decrease the point size in Qt Designer on one system currently. What can I do to assure the readablility of fonts on all systems?
Used systems are SLES 10, SLES11, Debian.
I have encountered a similar problem. In our case it had to do with the local Linux font settings. And since we couldn't force all computers in the world to use the same font we override the font in our application.
QFont _Font("Tahoma", 8);
QApplication::setFont(_Font);
You should do this before your main window is created.
The only risk I know of is, if by some chance the font you select is not installed on the computer, I believe it will go back to the default.
I hope that helps.
Use void QFont::setPixelSize(int pixelSize) instead of ::setPointSize.
Using this function makes the font device dependent. Use setPointSize() or setPointSizeF() to set the size of the font in a device independent manner.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With