aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick
diff options
context:
space:
mode:
authorSona Kurazyan <sona.kurazyan@qt.io>2019-08-02 14:41:10 +0200
committerSona Kurazyan <sona.kurazyan@qt.io>2019-08-23 22:42:35 +0200
commit506b4093b47f8ecf29c2e1e83e73e47e9ac767ad (patch)
treea3d9ac6d0e4b23b925f1df677178ac8cdde295d6 /tests/auto/quick
parentf6393ed0e4608bad4653f524c188bdc928e2d3b7 (diff)
Remove usages of deprecated APIs of QWheelEvent
Task-number: QTBUG-76491 Change-Id: I69b0c4ec7c03f9421b18828516e064eff2b45518 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'tests/auto/quick')
-rw-r--r--tests/auto/quick/qquickflickable/tst_qquickflickable.cpp15
-rw-r--r--tests/auto/quick/qquickitem/tst_qquickitem.cpp7
-rw-r--r--tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp2
3 files changed, 15 insertions, 9 deletions
diff --git a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
index 2314b82e8c..c104eecbcd 100644
--- a/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
+++ b/tests/auto/quick/qquickflickable/tst_qquickflickable.cpp
@@ -874,7 +874,8 @@ void tst_qquickflickable::wheel()
// test a vertical flick
{
QPoint pos(200, 200);
- QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(0,-120), -120, Qt::Vertical, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(0,-120),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
event.setAccepted(false);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -897,7 +898,8 @@ void tst_qquickflickable::wheel()
// test a horizontal flick
{
QPoint pos(200, 200);
- QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(-120,0), -120, Qt::Horizontal, Qt::NoButton, Qt::NoModifier);
+ QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(), QPoint(-120,0),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
event.setAccepted(false);
QGuiApplication::sendEvent(window.data(), &event);
@@ -926,7 +928,8 @@ void tst_qquickflickable::trackpad()
QPoint pos(200, 200);
{
- QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,-100), QPoint(0,-120), -120, Qt::Vertical, Qt::NoButton, Qt::NoModifier, Qt::ScrollBegin);
+ QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,-100), QPoint(0,-120),
+ Qt::NoButton, Qt::NoModifier, Qt::ScrollBegin, false);
event.setAccepted(false);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -938,7 +941,8 @@ void tst_qquickflickable::trackpad()
QCOMPARE(flick->contentY(), qreal(0));
{
- QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(-100,0), QPoint(-120,0), -120, Qt::Horizontal, Qt::NoButton, Qt::NoModifier, Qt::ScrollUpdate);
+ QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(-100,0), QPoint(-120,0),
+ Qt::NoButton, Qt::NoModifier, Qt::ScrollUpdate, false);
event.setAccepted(false);
QGuiApplication::sendEvent(window.data(), &event);
}
@@ -947,7 +951,8 @@ void tst_qquickflickable::trackpad()
QCOMPARE(flick->contentY(), qreal(0));
{
- QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,0), QPoint(0,0), 0, Qt::Horizontal, Qt::NoButton, Qt::NoModifier, Qt::ScrollEnd);
+ QWheelEvent event(pos, window->mapToGlobal(pos), QPoint(0,0), QPoint(0,0),
+ Qt::NoButton, Qt::NoModifier, Qt::ScrollEnd, false);
event.setAccepted(false);
QGuiApplication::sendEvent(window.data(), &event);
}
diff --git a/tests/auto/quick/qquickitem/tst_qquickitem.cpp b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
index 7e132f97b6..b6e40d5117 100644
--- a/tests/auto/quick/qquickitem/tst_qquickitem.cpp
+++ b/tests/auto/quick/qquickitem/tst_qquickitem.cpp
@@ -83,8 +83,8 @@ protected:
event->accept();
++wheelCount;
timestamp = event->timestamp();
- lastWheelEventPos = event->pos();
- lastWheelEventGlobalPos = event->globalPos();
+ lastWheelEventPos = event->position().toPoint();
+ lastWheelEventGlobalPos = event->globalPosition().toPoint();
}
};
@@ -1462,7 +1462,8 @@ void tst_qquickitem::wheelEvent()
QPoint localPoint(width / 2, height / 2);
QPoint globalPoint = window.mapToGlobal(localPoint);
- QWheelEvent event(localPoint, globalPoint, -120, Qt::NoButton, Qt::NoModifier, Qt::Vertical);
+ QWheelEvent event(localPoint, globalPoint, QPoint(0, 0), QPoint(0, -120),
+ Qt::NoButton, Qt::NoModifier, Qt::NoScrollPhase, false);
event.setTimestamp(123456UL);
event.setAccepted(false);
QGuiApplication::sendEvent(&window, &event);
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
index 4215017db3..5844720aa4 100644
--- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
+++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp
@@ -1519,7 +1519,7 @@ void tst_QQuickMouseArea::onWheel()
QVERIFY(root != nullptr);
QWheelEvent wheelEvent(QPoint(10, 32), QPoint(10, 32), QPoint(60, 20), QPoint(0, 120),
- 0, Qt::Vertical,Qt::NoButton, Qt::ControlModifier);
+ Qt::NoButton, Qt::ControlModifier, Qt::NoScrollPhase, false);
QGuiApplication::sendEvent(&window, &wheelEvent);
QCOMPARE(root->property("angleDeltaY").toInt(), 120);