summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/styles/qstylesheetstyle
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:10:15 +0100
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-03-24 16:10:15 +0100
commit3b5c0bc0780f1749fed7c07bd8b691400a0282b7 (patch)
tree1022f5553ad5a0aca9b5f3b49ca38a01c2329d20 /tests/auto/widgets/styles/qstylesheetstyle
parentc79918733a194ebbe5a2fe1617c884659f3e4b9f (diff)
parent21f1738a94fc8544ece04b3b1ee03a11986fe59b (diff)
Merge remote-tracking branch 'origin/stable' into dev
Conflicts: src/gui/image/qjpeghandler.cpp Change-Id: I9db3acea7d5c82f5da679c8eaeb29431136665f0
Diffstat (limited to 'tests/auto/widgets/styles/qstylesheetstyle')
-rw-r--r--tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp32
1 files changed, 32 insertions, 0 deletions
diff --git a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
index 24e3ac2c99..5a36ffc671 100644
--- a/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
+++ b/tests/auto/widgets/styles/qstylesheetstyle/tst_qstylesheetstyle.cpp
@@ -99,6 +99,7 @@ private slots:
void task232085_spinBoxLineEditBg();
void changeStyleInChangeEvent();
void QTBUG15910_crashNullWidget();
+ void QTBUG36933_brokenPseudoClassLookup();
//at the end because it mess with the style.
void widgetStyle();
@@ -1656,6 +1657,37 @@ void tst_QStyleSheetStyle::QTBUG15910_crashNullWidget()
QVERIFY(QTest::qWaitForWindowExposed(&w));
}
+void tst_QStyleSheetStyle::QTBUG36933_brokenPseudoClassLookup()
+{
+ const int rowCount = 10;
+ const int columnCount = 10;
+
+ QTableWidget widget(rowCount, columnCount);
+
+ for (int row = 0; row < rowCount; ++row) {
+ for (int column = 0; column < columnCount; ++column)
+ widget.setItem(row, column, new QTableWidgetItem(QStringLiteral("row %1 column %2").arg(row + 1).arg(column + 1)));
+
+ // put no visible text for the vertical headers, but still put some text or they will collapse
+ widget.setVerticalHeaderItem(row, new QTableWidgetItem(QStringLiteral(" ")));
+ }
+
+ // parsing of this stylesheet must not crash, and it must be correctly applied
+ widget.setStyleSheet(QStringLiteral("QHeaderView::section:vertical { background-color: #FF0000 }"));
+
+ widget.show();
+ QVERIFY(QTest::qWaitForWindowExposed(&widget));
+
+ widget.activateWindow();
+ QApplication::setActiveWindow(&widget);
+ QVERIFY(QTest::qWaitForWindowActive(&widget));
+
+ QHeaderView *verticalHeader = widget.verticalHeader();
+ QImage image(verticalHeader->size(), QImage::Format_ARGB32);
+ verticalHeader->render(&image);
+ QVERIFY(testForColors(image, QColor(0xFF, 0x00, 0x00)));
+}
+
QTEST_MAIN(tst_QStyleSheetStyle)
#include "tst_qstylesheetstyle.moc"