[Qt-interest] Font size changes for each OS

william.crocker at analog.com william.crocker at analog.com
Thu Apr 22 17:23:05 CEST 2010



Silas Silva wrote:
> Hello all,
> 
> A badly designed application has fixed-sized widgets and fonts set on Qt
> Designer.  In a machine (with Fedora 9), fonts fit ok, in others (with
> Fedora 12 or Ubuntu) they get bigger.  What could be the cause of this
> problem?  75dpi vs. 100dpi fonts?
>


Rewrite the application and create the widgets in code.
This will only take a few minutes as that is how much time
was originally saved by using Qt Designer in the first place.

:-)

Bill


> I'm not going to discuss about the right and wrong ways of designing Qt
> apps.  This applications is badly designed, yeah, but I inherited this
> maintenance task.
> 
> So, I found several links on this list with several solutions:
> 
> - Set the application font: this works for the font family but doesn't
>   work for the font size, because they are non-default set in designer.
> 
> - Set fonts size with QFont's setPixelSize(): not practical, since there
>   are hundreds of widgets in UI files with hard-coded font sizes.
> 
> - Set the font path correctly, so it would pick 75dpi or 100dpi fonts:
>   that is great and I got this idea reading this thread:
> 
>   http://lists.trolltech.com/qt-interest/1999-01/thread00076-0.html
> 
>   But it doesn't seem to work, even though I just let one path in the
>   font path.  Is there anything I'm missing?
> 
> Any clue?  Any tips about how Qt font configuration works with X font
> configuration?
> 
> Thanks!
> 



More information about the Qt-interest-old mailing list