-
Bug
-
Resolution: Fixed
-
P1: Critical
-
6.9.2
-
None
-
-
14aa698cc (dev), 9dcb39044 (6.10)
Sometimes style sheet is not applied to child widgets.
Example application:
#include <QtWidgets> using namespace Qt::StringLiterals; class MyWidget : public QWidget { Q_OBJECT public: MyWidget() { auto lw = new QListWidget; auto lwi = new QListWidgetItem; lw->addItem(lwi); lw->setItemWidget(lwi, new QLabel(u"test"_s)); auto l = new QVBoxLayout(this); l->addWidget(lw); } }; int main(int argc, char *argv[]) { QApplication a(argc, argv); a.setStyle(u"Fusion"_s); a.setStyleSheet(u"MyWidget QLabel {color:red;}"_s); MyWidget w; w.show(); return a.exec(); } #include <main.moc>
Result (Qt 6.9.2): Text is white (dark mode), style is not applied.
Expected result (Qt 6.9.1 and older): Text is red.
Caused by: QTBUG-133332
- resulted from
-
QTBUG-133332 possible stackoverflow calling setWindowFlag() in style polish & unpolish
-
- Closed
-
For Gerrit Dashboard: QTBUG-139924 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
673495,4 | QWidget: fix propagating style with descendant selectors | dev | qt/qtbase | Status: MERGED | +2 | +1 |
678478,2 | QWidget: fix propagating style with descendant selectors | 6.10 | qt/qtbase | Status: MERGED | +2 | 0 |