Details
-
Bug
-
Resolution: Won't Do
-
Not Evaluated
-
None
-
6.2.3
-
None
Description
In Qt 6.2.3, QPalette::setBrush does not mark a color role as "modified" if the set brush corresponds to what the palette had, before.
This can cause that in a nested widget scenario, the child widget fails to set its individual palette.
#include <QApplication> #include <QPalette> #include <QVBoxLayout> #include <QWidget> void setThemePalette() { QPalette themePalette; themePalette.setColor(QPalette::Window, Qt::red); QApplication::setPalette(themePalette); } int main(int argc, char *argv[]) { setThemePalette(); QApplication a(argc, argv); /* Expected result: +--------------------+ | w1 (Qt::green) | | +--------------+ | | | w2 (Qt::red) | | | +--------------+ | | | +--------------------+ */ QWidget w1; QPalette p1; p1.setColor(QPalette::Window, Qt::green); w1.setPalette(p1); auto w2 = new QWidget; QPalette p2; p2.setColor(QPalette::Window, Qt::red); w2->setPalette(p2); w2->setAutoFillBackground(true); w2->setMinimumSize(100, 100); auto layout = new QVBoxLayout(&w1); layout->addWidget(w2); w1.show(); return a.exec(); }
Attachments
Issue Links
- relates to
-
QTCREATORBUG-26981 Welcome screen: QPalette issue after Qt 6.2.2 -> 6.2.3 upgrade
- Closed
- resulted in
-
QTCREATORBUG-28844 Switch Theme to dark but partially invalid
- Closed
For Gerrit Dashboard: QTBUG-100439 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
393629,6 | Core: Explicitly detach QPalette in WelcomePageHelpers | 7.0 | qt-creator/qt-creator | Status: MERGED | +2 | 0 |