diff options
author | Alexis Menard <alexis.menard@trolltech.com> | 2009-09-15 11:29:04 (GMT) |
---|---|---|
committer | Alexis Menard <alexis.menard@trolltech.com> | 2009-09-15 14:28:40 (GMT) |
commit | dc6e88c0dc5be96423498850c519afbad6e13989 (patch) | |
tree | f3a03207335b5c9dfc1c968a701e0107e0d7f101 /tests/auto/qgraphicsview | |
parent | ff3ce998bea1ef49c2e9548fb54e37292a121ec8 (diff) | |
download | Qt-dc6e88c0dc5be96423498850c519afbad6e13989.zip Qt-dc6e88c0dc5be96423498850c519afbad6e13989.tar.gz Qt-dc6e88c0dc5be96423498850c519afbad6e13989.tar.bz2 |
Fix QGraphicsView::scrollAfterResize autotest on Mac.
The auto-test was failing because it calculate the scrollbar indent
using style primitives. It's very fragile and doesn't work on MacOS
style (and may not work on other style too). Since we don't test style
stuff here, we can just apply the plastique style for this test.
Reviewed-by:TrustMe
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r-- | tests/auto/qgraphicsview/tst_qgraphicsview.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp index 6c1ac54..3bed9ce 100644 --- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp +++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp @@ -3072,9 +3072,11 @@ void tst_QGraphicsView::scrollAfterResize_data() QTest::addColumn<QTransform>("x2"); QTest::addColumn<QTransform>("x3"); - int frameWidth = qApp->style()->pixelMetric(QStyle::PM_DefaultFrameWidth); - int extent = qApp->style()->pixelMetric(QStyle::PM_ScrollBarExtent); - int inside = qApp->style()->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents); + QPlastiqueStyle *style = new QPlastiqueStyle; + + int frameWidth = style->pixelMetric(QStyle::PM_DefaultFrameWidth); + int extent = style->pixelMetric(QStyle::PM_ScrollBarExtent); + int inside = style->styleHint(QStyle::SH_ScrollView_FrameOnlyAroundContents); int viewportWidth = 300; int scrollBarIndent = viewportWidth - extent - (inside ? 4 : 2)*frameWidth; @@ -3096,6 +3098,7 @@ void tst_QGraphicsView::scrollAfterResize() QFETCH(QTransform, x3); QGraphicsView view; + view.setStyle(new QPlastiqueStyle); if (reverse) view.setLayoutDirection(Qt::RightToLeft); |