summaryrefslogtreecommitdiffstats
path: root/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp')
-rw-r--r--tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 7954d00..aa63753 100644
--- a/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -94,6 +94,7 @@ private slots:
void embeddedFonts();
void opaquePaintEvent_data();
void opaquePaintEvent();
+ void task188195_baseBackground();
//at the end because it mess with the style.
void widgetStyle();
@@ -1354,6 +1355,28 @@ void tst_QStyleSheetStyle::opaquePaintEvent()
QCOMPARE(cl.autoFillBackground(), !styled );
}
+void tst_QStyleSheetStyle::task188195_baseBackground()
+{
+ QTreeView tree;
+ tree.setStyleSheet( "QTreeView:disabled { background-color:#ab1251; }" );
+ tree.show();
+ QTest::qWait(20);
+ QImage image(tree.width(), tree.height(), QImage::Format_ARGB32);
+
+ tree.render(&image);
+ QVERIFY(testForColors(image, tree.palette().base().color()));
+ QVERIFY(!testForColors(image, QColor(0xab, 0x12, 0x51)));
+
+ tree.setEnabled(false);
+ tree.render(&image);
+ QVERIFY(testForColors(image, QColor(0xab, 0x12, 0x51)));
+
+ tree.setEnabled(true);
+ tree.render(&image);
+ QVERIFY(testForColors(image, tree.palette().base().color()));
+ QVERIFY(!testForColors(image, QColor(0xab, 0x12, 0x51)));
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)