summaryrefslogtreecommitdiffstats
path: root/tests/auto/gui
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-09-09 16:11:48 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-10-15 20:09:29 +0200
commit9cc040a806fd2e6f1458e801a99311168d594c77 (patch)
tree828ca4008a50f44b7b98f7e50f67d01951b4d9ba /tests/auto/gui
parent92b9dcfe2ba602fc396a4806597b9440ed63bded (diff)
Prepare for deprecating the QDesktopWidget
QDesktopWidget is marked as obsolete in docs, but it is not yet completely deprecated, some of its methods are still in use. Replace uses of the following methods marked as obsolete: - QDesktopWidget::screenNumber(QWidget*) -> QWidget::screen() - QDesktopWidget::screenGeometry(QWidget*) -> QWidget::screen()->geometry() - QDesktopWidget::availableGeometry(QWidget*) -> QWidget::screen()->availableGeometry() Task-number: QTBUG-76491 Change-Id: I2cca30f2b4caa6e6848e8190e09f959d2c272f33 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
Diffstat (limited to 'tests/auto/gui')
-rw-r--r--tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
index 13dc924f93..54bb8fe0bd 100644
--- a/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
+++ b/tests/auto/gui/kernel/qtouchevent/tst_qtouchevent.cpp
@@ -26,7 +26,7 @@
**
****************************************************************************/
-#include <QtWidgets/QDesktopWidget>
+#include <QtGui/QScreen>
#include <QtWidgets/QGraphicsItem>
#include <QtWidgets/QGraphicsScene>
#include <QtWidgets/QGraphicsView>
@@ -617,7 +617,7 @@ void tst_QTouchEvent::basicRawEventTranslation()
QPointF pos = touchWidget.rect().center();
QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint());
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QTouchEvent::TouchPoint rawTouchPoint;
rawTouchPoint.setId(0);
@@ -753,7 +753,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchScreen()
QPointF leftScreenPos = leftWidget.mapToGlobal(leftPos.toPoint());
QPointF rightScreenPos = rightWidget.mapToGlobal(rightPos.toPoint());
QPointF centerScreenPos = touchWidget.mapToGlobal(centerPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));
@@ -968,7 +968,7 @@ void tst_QTouchEvent::touchOnMultipleTouchscreens()
QPointF pos = touchWidget.rect().center();
QPointF screenPos = touchWidget.mapToGlobal(pos.toPoint());
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QVector<QTouchEvent::TouchPoint> rawTouchPoints(3);
rawTouchPoints[0].setId(0);
@@ -1131,7 +1131,7 @@ void tst_QTouchEvent::multiPointRawEventTranslationOnTouchPad()
QPointF leftScreenPos = leftWidget.mapToGlobal(leftPos.toPoint());
QPointF rightScreenPos = rightWidget.mapToGlobal(rightPos.toPoint());
QPointF centerScreenPos = touchWidget.mapToGlobal(centerPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));
@@ -1348,7 +1348,7 @@ void tst_QTouchEvent::basicRawEventTranslationOfIds()
screenPos << touchWidget.mapToGlobal(pos[i].toPoint());
}
QPointF delta(10, 10);
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QVector<QPointF> rawPosList;
rawPosList << QPointF(12, 34) << QPointF(56, 78);
@@ -1629,7 +1629,7 @@ void tst_QTouchEvent::deleteInRawEventTranslation()
QPointF leftScreenPos = leftWidget->mapToGlobal(leftPos.toPoint());
QPointF centerScreenPos = centerWidget->mapToGlobal(centerPos.toPoint());
QPointF rightScreenPos = rightWidget->mapToGlobal(rightPos.toPoint());
- QRectF screenGeometry = QApplication::desktop()->screenGeometry(&touchWidget);
+ QRectF screenGeometry = touchWidget.screen()->geometry();
QList<QTouchEvent::TouchPoint> rawTouchPoints;
rawTouchPoints.append(QTouchEvent::TouchPoint(0));