From 66a9c4b0b259fe9a61150b7394af0f31ebfd38ac Mon Sep 17 00:00:00 2001 From: Sona Kurazyan Date: Tue, 23 Jul 2019 14:33:31 +0200 Subject: Remove usages of deprecated APIs of QDesktopWidget - Replaced the usages of the following deprecated APIs: * QDesktopWidget::screenCount() -> QGuiApplication::screens().size() * QDesktopWidget::screenGeometry(int) -> QGuiApplication::screens().at() * QDesktopWidget::screenNumber(QPoint) -> QGuiApplication::screenAt(QPoint) - Added notes for the QWidget *QDesktopWidget::screen(int), which currently has no replacement. - Fixed the tests to build conditionally, only when these APIs are enabled. Task-number: QTBUG-76491 Change-Id: I2fdec96d0a6a4fc782c53549b05a5556412b8305 Reviewed-by: Volker Hilsheimer --- tests/manual/qcursor/qcursorhighdpi/main.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'tests/manual/qcursor/qcursorhighdpi/main.cpp') diff --git a/tests/manual/qcursor/qcursorhighdpi/main.cpp b/tests/manual/qcursor/qcursorhighdpi/main.cpp index 3b18bff91c..017f41eccd 100644 --- a/tests/manual/qcursor/qcursorhighdpi/main.cpp +++ b/tests/manual/qcursor/qcursorhighdpi/main.cpp @@ -356,15 +356,12 @@ int main(int argc, char *argv[]) QApplication app(argc, argv); MainWindowPtrList windows; - - QDesktopWidget *desktopWidget = app.desktop(); - const int lastScreen = arguments.contains("-p") ? 0 // Primary screen only - : desktopWidget->screenCount() - 1; // All screens + : QGuiApplication::screens().size() - 1; // All screens for (int s = lastScreen; s >= 0; --s) { - MainWindowPtr window(new MainWindow(desktopWidget->screen(s))); - const QPoint pos = desktopWidget->screenGeometry(s).center() - QPoint(200, 100); + MainWindowPtr window(new MainWindow()); + const QPoint pos = QGuiApplication::screens().at(s)->geometry().center() - QPoint(200, 100); window->move(pos); windows.append(window); window->show(); -- cgit v1.2.3