From 0f3528a7f686793598b341182f90d78423792e47 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Mon, 2 Jul 2012 17:49:16 +0200 Subject: [PATCH] tst_QWidget::gdiPainting fixed 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 --- tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp index 1dd855b59f..9a6a84309e 100644 --- a/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp +++ b/tests/auto/widgets/kernel/qwidget/tst_qwidget.cpp @@ -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(); }