aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-08-05 15:54:02 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-09-02 20:56:36 +0200
commit7f36556603f7ea6d3a15625c9057ea875a6b6f41 (patch)
tree894ecf66badcfeb5ced7d7499602fc7fe686588a
parent305c3cbfe3db51225ba30249cd70ed26a6c70c58 (diff)
Remove usages of deprecated APIs of QWheelEvent
Task-number: QTBUG-76491 Change-Id: I346ddb1e926047878ce57c88cea24d8a4689adaa Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Mitch Curtis <mitch.curtis@qt.io>
-rw-r--r--tests/auto/focus/tst_focus.cpp8
-rw-r--r--tests/auto/qquickdrawer/tst_qquickdrawer.cpp4
-rw-r--r--tests/auto/qquickpopup/tst_qquickpopup.cpp4
3 files changed, 12 insertions, 4 deletions
diff --git a/tests/auto/focus/tst_focus.cpp b/tests/auto/focus/tst_focus.cpp
index 958b996b..8a1b36ad 100644
--- a/tests/auto/focus/tst_focus.cpp
+++ b/tests/auto/focus/tst_focus.cpp
@@ -232,7 +232,9 @@ void tst_focus::policy()
QVERIFY(!control->hasActiveFocus());
// Qt::WheelFocus
- QWheelEvent wheelEvent(QPoint(control->width() / 2, control->height() / 2), 10, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent wheelEvent(QPointF(control->width() / 2, control->height() / 2), QPointF(),
+ QPoint(), QPoint(0, 10), Qt::NoButton, Qt::NoModifier,
+ Qt::NoScrollPhase, false);
QGuiApplication::sendEvent(control, &wheelEvent);
QVERIFY(!control->hasActiveFocus());
QVERIFY(!control->hasVisualFocus());
@@ -403,7 +405,9 @@ void tst_focus::scope()
QVERIFY(control->hasActiveFocus());
// Qt::WheelFocus
- QWheelEvent wheelEvent(QPoint(control->width() / 2, control->height() / 2), 10, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent wheelEvent(QPointF(control->width() / 2, control->height() / 2), QPointF(),
+ QPoint(), QPoint(0, 10), Qt::NoButton, Qt::NoModifier,
+ Qt::NoScrollPhase, false);
QGuiApplication::sendEvent(control, &wheelEvent);
QVERIFY(!child->hasActiveFocus());
QVERIFY(control->hasActiveFocus());
diff --git a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
index 816f9b67..97472a11 100644
--- a/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
+++ b/tests/auto/qquickdrawer/tst_qquickdrawer.cpp
@@ -613,7 +613,9 @@ void tst_QQuickDrawer::wheel_data()
static bool sendWheelEvent(QQuickItem *item, const QPoint &localPos, int degrees)
{
QQuickWindow *window = item->window();
- QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0), QPoint(0, 8 * degrees), 0, Qt::Vertical, Qt::NoButton, 0);
+ QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0),
+ QPoint(0, 8 * degrees), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase,
+ false);
QSpontaneKeyEvent::setSpontaneous(&wheelEvent);
return qGuiApp->notify(window, &wheelEvent);
}
diff --git a/tests/auto/qquickpopup/tst_qquickpopup.cpp b/tests/auto/qquickpopup/tst_qquickpopup.cpp
index c2f876b8..6eb9482c 100644
--- a/tests/auto/qquickpopup/tst_qquickpopup.cpp
+++ b/tests/auto/qquickpopup/tst_qquickpopup.cpp
@@ -741,7 +741,9 @@ void tst_QQuickPopup::wheel_data()
static bool sendWheelEvent(QQuickItem *item, const QPoint &localPos, int degrees)
{
QQuickWindow *window = item->window();
- QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0), QPoint(0, 8 * degrees), 0, Qt::Vertical, Qt::NoButton, 0);
+ QWheelEvent wheelEvent(localPos, item->window()->mapToGlobal(localPos), QPoint(0, 0),
+ QPoint(0, 8 * degrees), Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase,
+ false);
QSpontaneKeyEvent::setSpontaneous(&wheelEvent);
return qGuiApp->notify(window, &wheelEvent);
}