summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles
diff options
context:
space:
mode:
authorAlexandru Croitor <alexandru.croitor@qt.io>2019-05-28 16:41:49 +0200
committerAlexandru Croitor <alexandru.croitor@qt.io>2019-06-03 15:14:42 +0200
commite4079eca49adce16e31dac2a18d49d7a55817891 (patch)
tree1dfb960ec1115b1f552afe8a013058542389505e /tests/auto/widgets/styles
parentf32a6cfb6b6236533508901f114ab57396da8ff3 (diff)
parentec6dc5f78453048c4f0604655a34c6c20c79d819 (diff)
Merge remote-tracking branch 'origin/dev' into wip/cmake
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());