diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index d6a663a..d7e9a1e 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -3516,6 +3516,7 @@ void QQuickItem::wheelEvent(QWheelEvent *event) */ void QQuickItem::touchEvent(QTouchEvent *event) { + qDebug() << __FUNCTION__ << event; event->ignore(); } @@ -4430,6 +4431,7 @@ void QQuickItemPrivate::deliverFocusEvent(QFocusEvent *e) void QQuickItemPrivate::deliverMouseEvent(QMouseEvent *e) { + qDebug() << __FUNCTION__ << e; Q_Q(QQuickItem); Q_ASSERT(e->isAccepted()); diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 4a34ada..a4cad14 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -421,6 +421,7 @@ static QMouseEvent *touchToMouseEvent(QEvent::Type type, const QTouchEvent::Touc transformedVelocity = transformMatrix.mapVector(p.velocity()).toVector2D(); } QGuiApplicationPrivate::setMouseEventCapsAndVelocity(me, event->device()->capabilities(), transformedVelocity); + qDebug() << __FUNCTION__ << me; return me; } @@ -449,6 +450,7 @@ bool QQuickWindowPrivate::checkIfDoubleClicked(ulong newPressEventTimestamp) bool QQuickWindowPrivate::translateTouchToMouse(QQuickItem *item, QTouchEvent *event) { + qDebug() << __FUNCTION__; Q_Q(QQuickWindow); // For each point, check if it is accepted, if not, try the next point. // Any of the fingers can become the mouse one. @@ -570,6 +572,7 @@ Translates the data in \a touchEvent to this window. This method leaves the ite */ void QQuickWindowPrivate::translateTouchEvent(QTouchEvent *touchEvent) { + qDebug() << "QQuickWindowPrivate::translateTouchEvent" << touchEvent; QList touchPoints = touchEvent->touchPoints(); for (int i = 0; i < touchPoints.count(); ++i) { QTouchEvent::TouchPoint &touchPoint = touchPoints[i]; @@ -1157,7 +1160,9 @@ bool QQuickWindow::event(QEvent *e) QTouchEvent *touch = static_cast(e); d->translateTouchEvent(touch); // return in order to avoid the QWindow::event below - return d->deliverTouchEvent(touch); + const bool r = d->deliverTouchEvent(touch); + qDebug() << Q_FUNC_INFO << r; + return r; } break; case QEvent::TouchCancel: @@ -1551,6 +1556,7 @@ bool QQuickWindowPrivate::deliverTouchCancelEvent(QTouchEvent *event) // call deliverTouchPoints to actually dispatch the points bool QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event) { + qDebug() << __FUNCTION__ << event; #ifdef TOUCH_DEBUG if (event->type() == QEvent::TouchBegin) qWarning() << "touchBeginEvent"; @@ -1614,6 +1620,7 @@ bool QQuickWindowPrivate::deliverTouchEvent(QTouchEvent *event) // This function recurses and sends the events to the individual items bool QQuickWindowPrivate::deliverTouchPoints(QQuickItem *item, QTouchEvent *event, const QList &newPoints, QSet *acceptedNewPoints, QHash > *updatedPoints) { + qDebug() << __FUNCTION__ << event << updatedPoints->size(); QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); if (itemPrivate->flags & QQuickItem::ItemClipsChildrenToShape) { @@ -1692,6 +1699,7 @@ bool QQuickWindowPrivate::deliverTouchPoints(QQuickItem *item, QTouchEvent *even // They are all pre-transformed, too. bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QTouchEvent *event, QSet *acceptedNewPoints, const QSet &matchingNewPoints, const QList &matchingPoints) { + qDebug() << __FUNCTION__ << item << matchingPoints.size(); QScopedPointer touchEvent(touchEventWithPoints(*event, matchingPoints)); touchEvent.data()->setTarget(item); bool touchEventAccepted = false; @@ -1711,6 +1719,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QTouchEv QQuickItemPrivate *itemPrivate = QQuickItemPrivate::get(item); itemPrivate->deliverTouchEvent(touchEvent.data()); touchEventAccepted = touchEvent->isAccepted(); + qDebug() << __FUNCTION__ << "delivered to " << itemPrivate << touchEventAccepted; // If the touch event wasn't accepted, synthesize a mouse event and see if the item wants it. if (!touchEventAccepted && (itemPrivate->acceptedMouseButtons() & Qt::LeftButton)) { @@ -1734,6 +1743,7 @@ bool QQuickWindowPrivate::deliverMatchingPointsToItem(QQuickItem *item, QTouchEv itemForTouchPointId.remove(id); } + qDebug() << __FUNCTION__ << "returns " << touchEventAccepted; return touchEventAccepted; } @@ -2002,6 +2012,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem // targetEvent is already transformed wrt local position, velocity, etc. QScopedPointer mouseEvent(touchToMouseEvent(t, targetEvent->touchPoints().first(), event, item, false)); + qDebug() << Q_FUNC_INFO << "mouse event" << mouseEvent.data(); if (target->childMouseEventFilter(item, mouseEvent.data())) { itemForTouchPointId[tp.id()] = target; touchMouseId = tp.id(); @@ -2017,6 +2028,7 @@ bool QQuickWindowPrivate::sendFilteredTouchEvent(QQuickItem *target, QQuickItem bool QQuickWindowPrivate::sendFilteredMouseEvent(QQuickItem *target, QQuickItem *item, QEvent *event) { + qDebug() << __FUNCTION__ << target; if (!target) return false;