summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/gui/image/qpixmap/tst_qpixmap.cpp')
-rw-r--r--tests/auto/gui/image/qpixmap/tst_qpixmap.cpp19
1 files changed, 7 insertions, 12 deletions
diff --git a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
index 16fccb7491..b3d578ef3e 100644
--- a/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
+++ b/tests/auto/gui/image/qpixmap/tst_qpixmap.cpp
@@ -733,10 +733,7 @@ void tst_QPixmap::grabWindow()
QWidget w;
w.resize(640, 480);
w.show();
- QTest::qWait(100);
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&w);
-#endif
+ QVERIFY(QTest::qWaitForWindowExposed(&w));
QVERIFY(QPixmap::grabWindow(w.winId()).isNull() == false);
QWidget child(&w);
@@ -744,14 +741,12 @@ void tst_QPixmap::grabWindow()
child.setPalette(Qt::red);
child.setAutoFillBackground(true);
child.show();
- QTest::qWait(100);
-#ifdef Q_WS_X11
- qt_x11_wait_for_window_manager(&child);
-#endif
-
- QPixmap grabWindowPixmap = QPixmap::grabWindow(child.winId());
- QPixmap grabWidgetPixmap = QPixmap::grabWidget(&child);
- lenientCompare(grabWindowPixmap, grabWidgetPixmap);
+ QTest::qWait(20);
+ const QPixmap grabWidgetPixmap = QPixmap::grabWidget(&child);
+ const WId childWinId = child.winId(); // Create native child
+ QVERIFY(QTest::qWaitForWindowExposed(child.windowHandle()));
+ const QPixmap grabWindowPixmap = QPixmap::grabWindow(childWinId);
+ QVERIFY(lenientCompare(grabWindowPixmap, grabWidgetPixmap));
#endif
}