[Qt-interest] Picking default fonts

Nikos Chantziaras realnc at arcor.de
Sun Mar 21 21:45:16 CET 2010


On Gnome and KDE, there are default "general" and "fixed width" fonts. 
That way, all applications that need to display fixed-width fonts (like 
a text editor) always use the font the user set globally.  Is there any 
way I can get those fonts from within a Qt application?  I guess the 
default QApplication::font() would be the "general" font.  What about 
the default fixed-width font?  Right now I simply use "Courier" for 
fixed-width fonts, but that's not a nice behavior.

I would normally use QFont::setStyleHint() and then 
QFont::defaultFamily(), but unfortunately:

   "Qt does not support style hints on X11 since this
    information is not provided by the window system."



More information about the Qt-interest-old mailing list