summaryrefslogtreecommitdiffstats
path: root/tests/auto
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-10-28 12:30:28 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-10-28 12:56:26 (GMT)
commitf62e0f8323304b2afbf2e3b918d611ea1d0f6856 (patch)
treec26cbcebd627f517e901d782ebc352f3da61c1d9 /tests/auto
parent9862d354c0e2135df848dd02417f958b1d7e16f5 (diff)
downloadQt-f62e0f8323304b2afbf2e3b918d611ea1d0f6856.zip
Qt-f62e0f8323304b2afbf2e3b918d611ea1d0f6856.tar.gz
Qt-f62e0f8323304b2afbf2e3b918d611ea1d0f6856.tar.bz2
Stabilize tst_QGraphicsView::optimizationFlags_dontSavePainterState2
Make sure the view is painted, otherwise the transforms are identity and comparisons don't make sense.
Diffstat (limited to 'tests/auto')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 092f81d..89628d8 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -2486,7 +2486,7 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState2()
scene.addRect(0, 0, 20, 20)->setTransform(QTransform::fromScale(2, 2));
scene.addRect(50, 50, 20, 20)->setTransform(QTransform::fromTranslate(200, 200));
- QGraphicsView view(&scene);
+ CustomView view(&scene);
if (!savePainter)
view.setOptimizationFlag(QGraphicsView::DontSavePainterState);
view.rotate(45);
@@ -2495,7 +2495,11 @@ void tst_QGraphicsView::optimizationFlags_dontSavePainterState2()
#ifdef Q_WS_X11
qt_x11_wait_for_window_manager(&view);
#endif
- QTest::qWait(150);
+
+ // Make sure the view is repainted; otherwise the tests below will fail.
+ view.viewport()->repaint();
+ QTest::qWait(200);
+ QVERIFY(view.painted);
// Make sure the painter's world transform is preserved after drawItems.
const QTransform expectedTransform = view.viewportTransform();