summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2019-04-16 09:34:50 +0200
committerLiang Qi <liang.qi@qt.io>2019-04-16 09:34:50 +0200
commit9d67bf6e9635505bd9523a3007f8e531f890c88f (patch)
treea4b8a21313b4ac66bb1e96d90504a001863e2f22 /tests/auto/widgets/styles
parent12b96dbb81a1a7bc5ffc08c24942038b007985e9 (diff)
parent5b3dfa470ed7ea40103daa785286ab71fb7aa230 (diff)
Merge remote-tracking branch 'origin/5.12' into 5.13
Conflicts: src/corelib/tools/qlocale.qdoc tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Done-with: Edward Welbourne <edward.welbourne@qt.io> Done-with: Volker Hilsheimer <volker.hilsheimer@qt.io> Change-Id: I88e0757b2d020f0a244714c87844631df4b3fd13
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp21
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 61b1fed1f8..a671a6c4d8 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -48,6 +48,7 @@ public:
private slots:
void init();
void repolish();
+ void repolish_without_crashing();
void numinstances();
void widgetsBeforeAppStyleSheet();
void widgetsAfterAppStyleSheet();
@@ -367,6 +368,26 @@ void tst_QStyleSheetStyle::repolish()
QCOMPARE(BACKGROUND(p1), APPBACKGROUND(p1));
}
+void tst_QStyleSheetStyle::repolish_without_crashing()
+{
+ // This used to crash, QTBUG-69204
+ QMainWindow w;
+ QScopedPointer<QSplitter> splitter1(new QSplitter(w.centralWidget()));
+ QScopedPointer<QSplitter> splitter2(new QSplitter);
+ QScopedPointer<QSplitter> splitter3(new QSplitter);
+ splitter2->addWidget(splitter3.data());
+
+ splitter2->setStyleSheet("color: red");
+ QScopedPointer<QLabel> label(new QLabel);
+ label->setTextFormat(Qt::RichText);
+ splitter3->addWidget(label.data());
+ label->setText("hey");
+
+ splitter1->addWidget(splitter2.data());
+ w.show();
+ QCOMPARE(COLOR(*label), QColor(Qt::red));
+}
+
void tst_QStyleSheetStyle::widgetStyle()
{
qApp->setStyleSheet(QString());