tst_QWidget::gdiPainting fixed
authorJoerg Bornemann <joerg.bornemann@nokia.com>
Mon, 2 Jul 2012 15:49:16 +0000 (17:49 +0200)
committerQt by Nokia <qt-info@nokia.com>
Tue, 3 Jul 2012 11:32:04 +0000 (13:32 +0200)
We cannot use QWidget::grab for widgets that have WA_PaintOnScreen set.
QScreen::grabWindow copies the real screen contents for us.

Change-Id: If1f6233ec48bcb2b941ea683c56ce71a39642e67
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@nokia.com>
tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp

index 1dd855b..9a6a843 100644 (file)
@@ -7844,7 +7844,8 @@ public:
 
 private slots:
     void slotTimer() {
-        const QImage im = grab(QRect(QPoint(0, 0), size())).toImage();
+        QScreen *screen = windowHandle()->screen();
+        const QImage im = screen->grabWindow(internalWinId(), 0, 0, -1, -1).toImage();
         color = im.pixel(1, 1);
         accept();
     }