aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick
diff options
context:
space:
mode:
authorRobin Burchell <robin.burchell@theqtcompany.com>2014-10-29 10:59:27 -0700
committerRobin Burchell <robin.burchell@viroteck.net>2014-10-29 19:56:01 +0100
commitaed97ab52133a06f998bf481be2b0d08b2107185 (patch)
tree2f5ce437cd840b7f4d2823219462f83252ad9c34 /src/quick
parenteacb331dcc9b95e1c00bb95fe5f0ce9fd4f80449 (diff)
QQuickWindow: Add some more stuff under DBG_TOUCH.
This is useful for understanding when touch is actually delivered, and what it goes to, which is useful for figuring out when something is incorrectly filtering mouse events in the scene (for instance). Change-Id: I9323629a42457b2b71e22ad489d8f1dc2d7b6fc5 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Diffstat (limited to 'src/quick')
-rw-r--r--src/quick/items/qquickwindow.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp
index b63915c51c..c7dde6d4aa 100644
--- a/src/quick/items/qquickwindow.cpp
+++ b/src/quick/items/qquickwindow.cpp
@@ -2022,11 +2022,14 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QTouchEv
touchEvent.data()->setTarget(item);
bool touchEventAccepted = false;
+ qCDebug(DBG_TOUCH) << " - considering delivering " << touchEvent << " to " << item;
+
// First check whether the parent wants to be a filter,
// and if the parent accepts the event we are done.
if (sendFilteredTouchEvent(item->parentItem(), item, event, hasFiltered)) {
// If the touch was accepted (regardless by whom or in what form),
// update acceptedNewPoints
+ qCDebug(DBG_TOUCH) << " - can't. intercepted " << touchEvent.data() << " to " << item->parentItem() << " instead of " << item;
foreach (int id, matchingNewPoints)
acceptedNewPoints->insert(id);
return true;
@@ -2037,6 +2040,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QTouchEv
itemForTouchPointId[id] = item;
// Deliver the touch event to the given item
+ qCDebug(DBG_TOUCH) << " - actually delivering " << touchEvent << " to " << item;
QCoreApplication::sendEvent(item, touchEvent.data());
touchEventAccepted = touchEvent->isAccepted();
@@ -2309,6 +2313,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
QScopedPointer<QTouchEvent> targetEvent(touchEventForItemBounds(target, *event));
if (!targetEvent->touchPoints().isEmpty()) {
if (target->childMouseEventFilter(item, targetEvent.data())) {
+ qCDebug(DBG_TOUCH) << " - first chance intercepted on childMouseEventFilter by " << target;
QVector<int> touchIds;
for (int i = 0; i < targetEvent->touchPoints().size(); ++i)
touchIds.append(targetEvent->touchPoints().at(i).id());
@@ -2349,6 +2354,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem
// targetEvent is already transformed wrt local position, velocity, etc.
QScopedPointer<QMouseEvent> mouseEvent(touchToMouseEvent(t, tp, event, item, false));
if (target->childMouseEventFilter(item, mouseEvent.data())) {
+ qCDebug(DBG_TOUCH) << " - second chance intercepted on childMouseEventFilter by " << target;
if (t != QEvent::MouseButtonRelease) {
itemForTouchPointId[tp.id()] = target;
touchMouseId = tp.id();
@@ -2561,7 +2567,9 @@ bool QQuickWindow::sendEvent(QQuickItem *item, QEvent *e)
case QEvent::TouchUpdate:
case QEvent::TouchEnd: {
QSet<QQuickItem*> hasFiltered;
- d->sendFilteredTouchEvent(item->parentItem(), item, static_cast<QTouchEvent *>(e), &hasFiltered);
+ QTouchEvent *ev = static_cast<QTouchEvent *>(e);
+ qCDebug(DBG_TOUCH) << " - sendEvent for " << ev << " to " << item->parentItem() << " and " << item;
+ d->sendFilteredTouchEvent(item->parentItem(), item, ev, &hasFiltered);
}
break;
default: