diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-11 01:00:18 +0200 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2019-10-11 01:00:19 +0200 |
commit | 66db74e53e3fa4aedeb519b8c8626066e1d6a1ce (patch) | |
tree | 619645d587124358a835341691ee20559865aea8 /tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | |
parent | bdc12f241118304a644f433bc3b75085c27a261d (diff) | |
parent | 45f95e74297ab3778965319c175a6d726f9c8afe (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I1359574c7d89aaf3328958e2f667ba1e599ff7f1
Diffstat (limited to 'tests/auto/quick/qquickpathview/tst_qquickpathview.cpp')
-rw-r--r-- | tests/auto/quick/qquickpathview/tst_qquickpathview.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp index 48d6c257a6..a8e847a5c7 100644 --- a/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp +++ b/tests/auto/quick/qquickpathview/tst_qquickpathview.cpp @@ -1616,16 +1616,55 @@ void tst_QQuickPathView::flickNClick() // QTBUG-77173 QQuickPathView *pathview = qobject_cast<QQuickPathView*>(window->rootObject()); QVERIFY(pathview != nullptr); + QSignalSpy movingChangedSpy(pathview, SIGNAL(movingChanged())); + QSignalSpy draggingSpy(pathview, SIGNAL(draggingChanged())); + QSignalSpy dragStartedSpy(pathview, SIGNAL(dragStarted())); + QSignalSpy dragEndedSpy(pathview, SIGNAL(dragEnded())); + QSignalSpy currentIndexSpy(pathview, SIGNAL(currentIndexChanged())); + QSignalSpy moveStartedSpy(pathview, SIGNAL(movementStarted())); + QSignalSpy moveEndedSpy(pathview, SIGNAL(movementEnded())); + QSignalSpy flickingSpy(pathview, SIGNAL(flickingChanged())); + QSignalSpy flickStartedSpy(pathview, SIGNAL(flickStarted())); + QSignalSpy flickEndedSpy(pathview, SIGNAL(flickEnded())); for (int duration = 100; duration > 0; duration -= 20) { + movingChangedSpy.clear(); + draggingSpy.clear(); + dragStartedSpy.clear(); + dragEndedSpy.clear(); + currentIndexSpy.clear(); + moveStartedSpy.clear(); + moveEndedSpy.clear(); + flickingSpy.clear(); + flickStartedSpy.clear(); + flickEndedSpy.clear(); // Dragging the child mouse area should animate the PathView (MA has no drag target) flick(window.data(), QPoint(200,200), QPoint(400,200), duration); QVERIFY(pathview->isMoving()); + QCOMPARE(movingChangedSpy.count(), 1); + QCOMPARE(draggingSpy.count(), 2); + QCOMPARE(dragStartedSpy.count(), 1); + QCOMPARE(dragEndedSpy.count(), 1); + QVERIFY(currentIndexSpy.count() > 0); + QCOMPARE(moveStartedSpy.count(), 1); + QCOMPARE(moveEndedSpy.count(), 0); + QCOMPARE(flickingSpy.count(), 1); + QCOMPARE(flickStartedSpy.count(), 1); + QCOMPARE(flickEndedSpy.count(), 0); // Now while it's still moving, click it. // The PathView should stop at a position such that offset is a whole number. QTest::mouseClick(window.data(), Qt::LeftButton, Qt::NoModifier, QPoint(200, 200)); QTRY_VERIFY(!pathview->isMoving()); + QCOMPARE(movingChangedSpy.count(), 2); // QTBUG-78926 + QCOMPARE(draggingSpy.count(), 2); + QCOMPARE(dragStartedSpy.count(), 1); + QCOMPARE(dragEndedSpy.count(), 1); + QCOMPARE(moveStartedSpy.count(), 1); + QCOMPARE(moveEndedSpy.count(), 1); + QCOMPARE(flickingSpy.count(), 2); + QCOMPARE(flickStartedSpy.count(), 1); + QCOMPARE(flickEndedSpy.count(), 1); QVERIFY(qFuzzyIsNull(pathview->offset() - int(pathview->offset()))); } } |