aboutsummaryrefslogtreecommitdiffstats
path: root/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp')
-rw-r--r--tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp29
1 files changed, 29 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
index de7e3f1629..dcc05f548b 100644
--- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
+++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp
@@ -67,6 +67,9 @@ public:
private slots:
void containsDrag_internal();
void containsDrag_external();
+
+ void ignoreRetriggerEvent();
+
void keys_internal();
void keys_external();
void source_internal();
@@ -829,6 +832,32 @@ void tst_QQuickDropArea::competingDrags()
QCOMPARE(evaluate<QString>(dropArea1, "statuslol"), QStringLiteral("parent"));
}
+void tst_QQuickDropArea::ignoreRetriggerEvent()
+{
+ QQuickView window;
+ QByteArray errorMessage;
+ QVERIFY2(QQuickTest::initView(window, testFileUrl("ignoreRetriggerEvent.qml"), true, &errorMessage), errorMessage.constData());
+
+ QQuickItem *dropArea = window.rootObject();
+ QVERIFY(dropArea);
+ QQuickItem *dragItem = dropArea->findChild<QQuickItem *>("dragItem");
+ QVERIFY(dragItem);
+
+ evaluate<void>(dragItem, "Drag.active = true");
+ // Drag the item within the drop area
+ dragItem->setPosition(QPointF(25, 25));
+ QCoreApplication::processEvents();
+ dragItem->setPosition(QPointF(50, 50));
+ QCoreApplication::processEvents();
+ dragItem->setPosition(QPointF(75, 75));
+ QCoreApplication::processEvents();
+
+ QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false);
+ QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1);
+ QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0);
+}
+
+
void tst_QQuickDropArea::simultaneousDrags()
{
QQuickWindow window;