[Interest] Issue with stylesheet and palette()

Massimiliano Maini maxmaini at gmail.com
Wed May 28 00:33:32 CEST 2014

Hi all,

I've stumbled on a potential issue concerning the usage of stylesheets and
QWidget::palette() (to get colors set by the stylesheet). In a nutshell,
accessing palette() within the constructor of the object (e.g QWidget) does
not work.

I've described the issue fully here:

Somebody has even provided a nice workaround (using QTimer::singleShot so
that the code accessing palette() is executed after the object creation is

I'm OK with the workaround, I'm posting here just to be sure the behaviour
is normal and not a bug.
If anybody has a better workaround, I'd be glad to read about it :)

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140527/0b361b7a/attachment.html>

More information about the Interest mailing list