summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorOlivier Goffart <ogoffart@trolltech.com>2009-11-20 11:16:31 +0100
committerOlivier Goffart <ogoffart@trolltech.com>2009-11-20 11:37:45 +0100
commit8fb9ed08c60b667737a9ae1b209da61fe9c67200 (patch)
tree31107a87808a53ff9abd779b20c6b4d0f090d116 /tests
parentd9fa92933ff6ff1afad342f7f94e37f810cf8176 (diff)
downloadqt4-tools-8fb9ed08c60b667737a9ae1b209da61fe9c67200.tar.gz
Fix for tabwidget usesScrollButton being overriden by stylesheet
Setting a stylesheet or reparenting a widget into a widget using style sheet would cause the usesScrollButtons to be reset. Instead we now keep the flag whenever it has been explicitly set by the user rather than querying from the style again. Task-number: QTBUG-3370 Reviewed-by: jbache
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/qtabbar/tst_qtabbar.cpp6
1 files changed, 5 insertions, 1 deletions
diff --git a/tests/auto/qtabbar/tst_qtabbar.cpp b/tests/auto/qtabbar/tst_qtabbar.cpp
index 2db72b924e..e83312d02a 100644
--- a/tests/auto/qtabbar/tst_qtabbar.cpp
+++ b/tests/auto/qtabbar/tst_qtabbar.cpp
@@ -295,6 +295,10 @@ void tst_QTabBar::setUsesScrollButtons()
if (usesArrows != -128)
tabBar.setUsesScrollButtons(usesArrows);
QTEST(tabBar.usesScrollButtons(), "expectedArrows");
+
+ // Make sure style sheet does not override user set mode
+ tabBar.setStyleSheet("QWidget { background-color: #ABA8A6;}");
+ QTEST(tabBar.usesScrollButtons(), "expectedArrows");
}
void tst_QTabBar::removeLastTab()
@@ -532,7 +536,7 @@ void tst_QTabBar::task251184_removeTab()
QCOMPARE(bar.count(), 1);
QCOMPARE(bar.currentIndex(), 0);
- QCOMPARE(bar.tabText(bar.currentIndex()), QString("bar2"));
+ QCOMPARE(bar.tabText(bar.currentIndex()), QString("bar2"));
}