diff options
author | Samuel Rødal <samuel.rodal@digia.com> | 2013-03-05 16:08:40 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2013-03-07 00:45:04 +0100 |
commit | 7128bcbbd5b0597bfb36e6f0b3d148d5dfb1c3bf (patch) | |
tree | 81c27e72ac042f094302940ccfc8313508f21c9a /tests/auto/opengl/qgl/tst_qgl.cpp | |
parent | a8c6708260544b8d801cf823c601f39c4f06bf74 (diff) |
Attempt to stabilize tst_qgl::graphicsViewClipping().
Make sure the graphics view is exposed and has been painted before
trying to grab the framebuffer.
Task-number: QTBUG-29943
Change-Id: I2945cb78b58265864744a0d5fc99fb430306b578
Reviewed-by: Gunnar Sletta <gunnar.sletta@digia.com>
Diffstat (limited to 'tests/auto/opengl/qgl/tst_qgl.cpp')
-rw-r--r-- | tests/auto/opengl/qgl/tst_qgl.cpp | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/tests/auto/opengl/qgl/tst_qgl.cpp b/tests/auto/opengl/qgl/tst_qgl.cpp index 6c5c90d737..d4d109b981 100644 --- a/tests/auto/opengl/qgl/tst_qgl.cpp +++ b/tests/auto/opengl/qgl/tst_qgl.cpp @@ -832,10 +832,19 @@ static void fuzzyCompareImages(const QImage &testImage, const QImage &referenceI class UnclippedWidget : public QWidget { public: + bool painted; + + UnclippedWidget() + : painted(false) + { + } + void paintEvent(QPaintEvent *) { QPainter p(this); p.fillRect(rect().adjusted(-1000, -1000, 1000, 1000), Qt::black); + + painted = true; } }; @@ -865,7 +874,9 @@ void tst_QGL::graphicsViewClipping() scene.setSceneRect(view.viewport()->rect()); - QVERIFY(QTest::qWaitForWindowActive(&view)); + QTest::qWaitForWindowExposed(&view); + + QTRY_VERIFY(widget->painted); QImage image = viewport->grabFrameBuffer(); QImage expected = image; |