diff options
Diffstat (limited to 'tests/auto/widgets/widgets')
-rw-r--r-- | tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp | 2 | ||||
-rw-r--r-- | tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp | 14 |
2 files changed, 6 insertions, 10 deletions
diff --git a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp index 12593298e8..4914caf788 100644 --- a/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp +++ b/tests/auto/widgets/widgets/qmdiarea/tst_qmdiarea.cpp @@ -901,7 +901,7 @@ void tst_QMdiArea::sizeHint() { QMdiArea workspace; workspace.show(); - QSize desktopSize = QApplication::desktop()->size(); + QSize desktopSize = QGuiApplication::primaryScreen()->size(); QSize expectedSize(desktopSize.width() * 2/3, desktopSize.height() * 2/3); QCOMPARE(workspace.sizeHint(), expectedSize); diff --git a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp index a18fd0299a..1e99bb4074 100644 --- a/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp +++ b/tests/auto/widgets/widgets/qopenglwidget/tst_qopenglwidget.cpp @@ -504,23 +504,19 @@ static inline QString msgRgbMismatch(unsigned actual, unsigned expected) static QPixmap grabWidgetWithoutRepaint(const QWidget *widget, QRect clipArea) { - const QWidget *targetWidget = widget; + const QWindow *window = widget->window()->windowHandle(); + Q_ASSERT(window); + WId windowId = window->winId(); + #ifdef Q_OS_WIN // OpenGL content is not properly grabbed on Windows when passing a top level widget window, // 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. - QWidget *desktopWidget = QApplication::desktop(QGuiApplication::primaryScreen()); - const QWidget *mainScreenWidget = desktopWidget; - targetWidget = mainScreenWidget; + windowId = 0; clipArea = QRect(widget->mapToGlobal(clipArea.topLeft()), widget->mapToGlobal(clipArea.bottomRight())); #endif - - const QWindow *window = targetWidget->window()->windowHandle(); - Q_ASSERT(window); - WId windowId = window->winId(); - QScreen *screen = window->screen(); Q_ASSERT(screen); |