summaryrefslogtreecommitdiffstats
path: root/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp')
-rw-r--r--tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
index cb4fc201f6..ccd8d0ec05 100644
--- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
+++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp
@@ -31,7 +31,6 @@
#include <QtGui/QPainter>
#include <QtGui/QScreen>
#include <QtGui/QStaticText>
-#include <QtWidgets/QDesktopWidget>
#include <QtWidgets/QGraphicsView>
#include <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsRectItem>
@@ -504,8 +503,8 @@ static QPixmap grabWidgetWithoutRepaint(const QWidget *widget, QRect clipArea)
// because GDI functions can't grab OpenGL layer content.
// Instead the whole screen should be captured, with an adjusted clip area, which contains
// the final composited content.
- QDesktopWidget *desktopWidget = QApplication::desktop();
- const QWidget *mainScreenWidget = desktopWidget->screen();
+ QWidget *desktopWidget = QApplication::desktop(QGuiApplication::primaryScreen());
+ const QWidget *mainScreenWidget = desktopWidget;
targetWidget = mainScreenWidget;
clipArea = QRect(widget->mapToGlobal(clipArea.topLeft()),
widget->mapToGlobal(clipArea.bottomRight()));