diff options
author | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-05-28 16:41:49 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2019-06-03 15:14:42 +0200 |
commit | e4079eca49adce16e31dac2a18d49d7a55817891 (patch) | |
tree | 1dfb960ec1115b1f552afe8a013058542389505e /tests/auto/widgets/styles | |
parent | f32a6cfb6b6236533508901f114ab57396da8ff3 (diff) | |
parent | ec6dc5f78453048c4f0604655a34c6c20c79d819 (diff) |
Merge remote-tracking branch 'origin/dev' into wip/cmake
Take 5.
Change-Id: Ifb2d20e95ba824e45e667fba6c2ba45389991cc3
Diffstat (limited to 'tests/auto/widgets/styles')
-rw-r--r-- | tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 21 |
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()); |