Details
-
Bug
-
Resolution: Cannot Reproduce
-
P2: Important
-
None
-
5.8.0
-
None
-
Windows 7 SP1 x64, Ubuntu 16.04.1 amd64
Description
When application palette is changed before a widget is shown all color roles are applied properly. But if you change app palette after showing the widget, the Button role color does not get updated. For instance in the following code color of push button remains unchanged:
#include <QApplication> #include <QPushButton> int main(int argc, char *argv[]) { QApplication a(argc, argv); qApp->setStyle("fusion"); QPalette palette; palette.setColor(QPalette::Button, Qt::black); QPushButton pb; pb.show(); for(int i=0;i<1000;i++) qApp->processEvents(QEventLoop::AllEvents); qApp->setPalette(palette); return a.exec(); }
This was not the case in Qt 5.7. I have tested the code in Windows and Linux, both have this problem. It seems that the problem is only for Button role and other roles are changed properly.