[Qt-interest] Issue with style sheets ?

Olivier Goffart ogoffart at trolltech.com
Mon Mar 2 14:37:39 CET 2009


On Monday 02 March 2009 13:52:45 Surya Kiran Gullapalli wrote:
> Hello,
> I've this Qt-Application, where in I provide user an option to change the
> font of the application at run time.
>
> I've a Preferences Dialog, with a push button, which when clicked opens up
> a QFontDialog. After the font is selected, and user clicked an Apply button
> on the Dialog,
> the selected font is set using qApp->setFont(QFont) function.
>
> This was working fine, till the other day when I introduced Stylesheets in
> my application.

Hi, 

As stated in the documentation QApplication::setFont, this function cannot be 
used in combination with stylesheet.

The workaround is to set the font with stylesheet, adding something like
* { font: ....  }   in the stylesheet string





More information about the Qt-interest-old mailing list