diff options
Diffstat (limited to 'tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp')
-rw-r--r-- | tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp index c9a9378905..45b3b879b7 100644 --- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp +++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp @@ -94,6 +94,7 @@ private slots: void layoutSpacing(); #endif void qproperty(); + void qproperty_styleSheet(); void palettePropagation_data(); void palettePropagation(); void fontPropagation_data(); @@ -680,6 +681,23 @@ void tst_QStyleSheetStyle::qproperty() QCOMPARE(pb.isChecked(), false); } +void tst_QStyleSheetStyle::qproperty_styleSheet() +{ + QWidget w; + auto checkBox = new QCheckBox("check", &w); + QString sheet = R"(QCheckBox { qproperty-styleSheet: "QCheckBox { qproperty-text: foobar; }"; })"; + + QVERIFY(w.property("styleSheet").toString().isEmpty()); + + w.setStyleSheet(sheet); + QCOMPARE(checkBox->text(), "check"); + + //recursion crash + w.ensurePolished(); + QCOMPARE(w.property("styleSheet").toString(), sheet); + QCOMPARE(checkBox->text(), "foobar"); +} + namespace ns { class PushButton1 : public QPushButton { Q_OBJECT |