diff options
author | Andrew den Exter <andrew.den-exter@nokia.com> | 2012-03-02 12:58:45 +1000 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-05-25 14:44:05 +0200 |
commit | 7f626e206614f6030ee0fc994eb9b3602f133d87 (patch) | |
tree | a212d0f4eae0535ebba56f9f9d848a4dfdab856e /tests/auto/quick/qquickdroparea | |
parent | 9ce3a474e6eae130aa3d1c28e84f934dc3f01d19 (diff) |
Don't deliver drag move events immediately.
Rather than delivering drag move events everytime the position of an
item changes queue up an event to process in the event loop. This
filters out noisy intermediate positions particularly where the x and
y values are set independently and better insulates against feedback.
Change-Id: I5d787d63ed01441a9080d0daaee9db1373d5f073
Reviewed-by: Martin Jones <martin.jones@nokia.com>
Diffstat (limited to 'tests/auto/quick/qquickdroparea')
-rw-r--r-- | tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp index 8b4b63f19f..b59e767be9 100644 --- a/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp +++ b/tests/auto/quick/qquickdroparea/tst_qquickdroparea.cpp @@ -153,6 +153,7 @@ void tst_QQuickDropArea::containsDrag_internal() QCOMPARE(evaluate<int>(dropArea, "exitEvents"), 0); dragItem->setPos(QPointF(50, 50)); + QCoreApplication::processEvents(); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), true); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), true); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 1); @@ -160,6 +161,7 @@ void tst_QQuickDropArea::containsDrag_internal() evaluate<void>(dropArea, "{ enterEvents = 0; exitEvents = 0 }"); dragItem->setPos(QPointF(150, 50)); + QCoreApplication::processEvents(); QCOMPARE(evaluate<bool>(dropArea, "containsDrag"), false); QCOMPARE(evaluate<bool>(dropArea, "hasDrag"), false); @@ -543,6 +545,7 @@ void tst_QQuickDropArea::position_internal() evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }"); dragItem->setPos(QPointF(40, 50)); + QCoreApplication::processEvents(); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1); QCOMPARE(evaluate<qreal>(dropArea, "drag.x"), qreal(40)); @@ -554,6 +557,7 @@ void tst_QQuickDropArea::position_internal() evaluate<void>(dropArea, "{ enterEvents = 0; moveEvents = 0; eventX = -1; eventY = -1 }"); dragItem->setPos(QPointF(75, 25)); + QCoreApplication::processEvents(); QCOMPARE(evaluate<int>(dropArea, "enterEvents"), 0); QCOMPARE(evaluate<int>(dropArea, "moveEvents"), 1); QCOMPARE(evaluate<qreal>(dropArea, "drag.x"), qreal(75)); |