diff options
-rw-r--r-- | src/gui/kernel/qgesturemanager.cpp | 3 | ||||
-rw-r--r-- | tests/auto/gestures/tst_gestures.cpp | 14 |
2 files changed, 8 insertions, 9 deletions
diff --git a/src/gui/kernel/qgesturemanager.cpp b/src/gui/kernel/qgesturemanager.cpp index b4913f0..6f1aec4 100644 --- a/src/gui/kernel/qgesturemanager.cpp +++ b/src/gui/kernel/qgesturemanager.cpp @@ -456,8 +456,9 @@ void QGestureManager::deliverEvents(const QSet<QGesture *> &gestures, normalStartedGestures[target].append(gesture); } } else { - qWarning() << "QGestureManager::deliverEvent: could not find the target for gesture" + DEBUG() << "QGestureManager::deliverEvent: could not find the target for gesture" << gesture->gestureType(); + qWarning("QGestureManager::deliverEvent: could not find the target for gesture"); undeliveredGestures->insert(gesture); } } diff --git a/tests/auto/gestures/tst_gestures.cpp b/tests/auto/gestures/tst_gestures.cpp index 28dd40c..0c09265 100644 --- a/tests/auto/gestures/tst_gestures.cpp +++ b/tests/auto/gestures/tst_gestures.cpp @@ -703,18 +703,16 @@ void tst_Gestures::graphicsItemGesture() static const int TotalCustomEventsCount = CustomGesture::SerialFinishedThreshold - CustomGesture::SerialMaybeThreshold + 1; CustomEvent event; + // gesture without hotspot should not be delivered to items in the view + QTest::ignoreMessage(QtWarningMsg, "QGestureManager::deliverEvent: could not find the target for gesture"); + QTest::ignoreMessage(QtWarningMsg, "QGestureManager::deliverEvent: could not find the target for gesture"); + QTest::ignoreMessage(QtWarningMsg, "QGestureManager::deliverEvent: could not find the target for gesture"); + QTest::ignoreMessage(QtWarningMsg, "QGestureManager::deliverEvent: could not find the target for gesture"); sendCustomGesture(&event, item, &scene); QCOMPARE(item->customEventsReceived, TotalCustomEventsCount); - QCOMPARE(item->gestureEventsReceived, TotalGestureEventsCount); + QCOMPARE(item->gestureEventsReceived, 0); QCOMPARE(item->gestureOverrideEventsReceived, 0); - QCOMPARE(item->events.all.size(), TotalGestureEventsCount); - for(int i = 0; i < item->events.all.size(); ++i) - QCOMPARE(item->events.all.at(i), CustomGesture::GestureType); - QCOMPARE(item->events.started.size(), 1); - QCOMPARE(item->events.updated.size(), TotalGestureEventsCount - 2); - QCOMPARE(item->events.finished.size(), 1); - QCOMPARE(item->events.canceled.size(), 0); item->reset(); |