diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-08-22 15:54:13 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2017-08-23 19:03:20 +0000 |
commit | 4003b9cf9c3998bbf6654c9eb808657b4d55568b (patch) | |
tree | ff620da3a3fb4851fad13917d0344c2b1c485e50 /src/quick/items/qquickwindow.cpp | |
parent | 460925b3f1dd9d2301b9c69558bd68843cd5f978 (diff) |
improve cat. logging during event delivery to child-filtering items
It's useful to see target items and parents which need to filter events for them,
together.
Change-Id: I2d072a91ccb382077caf71b7413a9a10b34cb121
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items/qquickwindow.cpp')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index bc99f49667..c03b362ab8 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2720,13 +2720,6 @@ QQuickItem *QQuickWindowPrivate::findCursorItem(QQuickItem *item, const QPointF void QQuickWindowPrivate::updateFilteringParentItems(const QVector<QQuickItem *> &targetItems) { - if (Q_UNLIKELY(DBG_MOUSE_TARGET().isDebugEnabled())) { - // qDebug() << map(&objectName, targetItems) but done the hard way because C++ is still that primitive - QStringList targetNames; - for (QQuickItem *t : targetItems) - targetNames << (QLatin1String(t->metaObject()->className()) + QLatin1Char(' ') + t->objectName()); - qCDebug(DBG_MOUSE_TARGET) << "finding potential filtering parents of" << targetNames; - } filteringParentItems.clear(); for (QQuickItem *item : targetItems) { #if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0) @@ -2753,6 +2746,13 @@ void QQuickWindowPrivate::updateFilteringParentItems(const QVector<QQuickItem *> parent = parent->parentItem(); } } + if (Q_UNLIKELY(DBG_MOUSE_TARGET().isDebugEnabled())) { + QStringList l; + for (QPair<QQuickItem *,QQuickItem *> pair : filteringParentItems) + l << (QLatin1String(pair.first->metaObject()->className()) + QLatin1Char(' ') + pair.first->objectName() + + QLatin1String(" <- ") + pair.second->metaObject()->className()) + QLatin1Char(' ') + pair.second->objectName(); + qCDebug(DBG_MOUSE_TARGET) << "potential filtering parents:" << l; + } } bool QQuickWindowPrivate::sendFilteredPointerEvent(QQuickPointerEvent *event, QQuickItem *receiver, QQuickItem **itemThatFiltered) @@ -2873,7 +2873,7 @@ bool QQuickWindowPrivate::sendFilteredMouseEvent(QQuickItem *target, QQuickItem hasFiltered->insert(target); if (target->childMouseEventFilter(item, event)) filtered = true; - qCDebug(DBG_MOUSE_TARGET) << target << "childMouseEventFilter ->" << filtered; + qCDebug(DBG_MOUSE_TARGET) << "for" << item << target << "childMouseEventFilter ->" << filtered; } return sendFilteredMouseEvent(target->parentItem(), item, event, hasFiltered) || filtered; |