diff options
Diffstat (limited to 'tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp')
-rw-r--r-- | tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp index 4375e835aa..0b4a6fa438 100644 --- a/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp +++ b/tests/auto/quick/qquickmousearea/tst_qquickmousearea.cpp @@ -73,6 +73,7 @@ private slots: void hoverPropagation(); void hoverVisible(); void disableAfterPress(); + void onWheel(); private: QQuickView *createView(); @@ -906,6 +907,26 @@ void tst_QQuickMouseArea::disableAfterPress() delete canvas; } +void tst_QQuickMouseArea::onWheel() +{ + QQuickView *canvas = createView(); + canvas->setSource(testFileUrl("wheel.qml")); + + QQuickItem *root = canvas->rootObject(); + QVERIFY(root != 0); + + QWheelEvent wheelEvent(QPoint(10, 32), QPoint(10, 32), QPoint(60, 20), QPoint(0, 120), + 0, Qt::Vertical,Qt::NoButton, Qt::ControlModifier); + QGuiApplication::sendEvent(canvas, &wheelEvent); + + QCOMPARE(root->property("angleDeltaY").toInt(), 120); + QCOMPARE(root->property("mouseX").toReal(), qreal(10)); + QCOMPARE(root->property("mouseY").toReal(), qreal(32)); + QCOMPARE(root->property("controlPressed").toBool(), true); + + delete canvas; +} + QTEST_MAIN(tst_QQuickMouseArea) #include "tst_qquickmousearea.moc" |