summaryrefslogtreecommitdiffstats
path: root/tests/auto/qgraphicsview
diff options
context:
space:
mode:
authorBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-13 14:35:34 (GMT)
committerBjørn Erik Nilsen <bjorn.nilsen@nokia.com>2009-07-15 10:39:40 (GMT)
commitfc7a6a7f9f857c4745476213ee41d9a92ce82a9c (patch)
tree461d6531ff5917dc73712972e9e5e1b9f73cbb1c /tests/auto/qgraphicsview
parent0d721a3b390b3f542be594941430ecfcac29f0ac (diff)
downloadQt-fc7a6a7f9f857c4745476213ee41d9a92ce82a9c.zip
Qt-fc7a6a7f9f857c4745476213ee41d9a92ce82a9c.tar.gz
Qt-fc7a6a7f9f857c4745476213ee41d9a92ce82a9c.tar.bz2
Make Graphics View auto-tests less dependant on WS.
Several auto-tests failed on the Mac because the view get two paint events on the first show. This is a bug in QWidget, but shouldn't make graphics view auto-tests fail. Also, there's no difference between update() and repaint() on the Mac.
Diffstat (limited to 'tests/auto/qgraphicsview')
-rw-r--r--tests/auto/qgraphicsview/tst_qgraphicsview.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
index 9a5089b..37c5967 100644
--- a/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
+++ b/tests/auto/qgraphicsview/tst_qgraphicsview.cpp
@@ -3338,6 +3338,15 @@ void tst_QGraphicsView::render()
{
// ### This test can be much more thorough - see QGraphicsScene::render.
QGraphicsScene scene;
+ QGraphicsView view(&scene);
+ view.setFrameStyle(0);
+ view.resize(200, 200);
+ view.show();
+#ifdef Q_WS_X11
+ qt_x11_wait_for_window_manager(&view);
+#endif
+ QTest::qWait(200);
+
RenderTester *r1 = new RenderTester(QRectF(0, 0, 50, 50));
RenderTester *r2 = new RenderTester(QRectF(50, 50, 50, 50));
RenderTester *r3 = new RenderTester(QRectF(0, 50, 50, 50));
@@ -3347,14 +3356,7 @@ void tst_QGraphicsView::render()
scene.addItem(r3);
scene.addItem(r4);
- QGraphicsView view(&scene);
- view.setFrameStyle(0);
- view.resize(200, 200);
- view.show();
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&view);
-#endif
- QTest::qWait(200);
+ qApp->processEvents();
QCOMPARE(r1->paints, 1);
QCOMPARE(r2->paints, 1);