summaryrefslogtreecommitdiffstats
path: root/tests/auto/other/macgui/tst_macgui.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/other/macgui/tst_macgui.cpp')
-rw-r--r--tests/auto/other/macgui/tst_macgui.cpp8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/auto/other/macgui/tst_macgui.cpp b/tests/auto/other/macgui/tst_macgui.cpp
index 75fa4815c9..56d698aa8f 100644
--- a/tests/auto/other/macgui/tst_macgui.cpp
+++ b/tests/auto/other/macgui/tst_macgui.cpp
@@ -34,6 +34,7 @@
#include <QScrollBar>
#include <QProgressDialog>
#include <QSpinBox>
+#include <QScreen>
#include <guitest.h>
@@ -53,7 +54,12 @@ private slots:
QPixmap grabWindowContents(QWidget * widget)
{
- return QPixmap::grabWindow(widget->winId());
+ QScreen *screen = widget->window()->windowHandle()->screen();
+ if (!screen) {
+ qWarning() << "Grabbing pixmap failed, no QScreen for" << widget;
+ return QPixmap();
+ }
+ return screen->grabWindow(widget->winId());
}
/*