diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-13 08:23:24 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-11-13 20:39:32 +0100 |
commit | 0a9edf4d98d899dcc2f439b262b72361f5a06e79 (patch) | |
tree | 73447bcdb3a412c7801bfa1ff16869b9a1dc7a5f /src | |
parent | 39065e1cecdeb3f13917d48ff6381ffd6bcfc52f (diff) |
QQuickWindow: better hover debug, and a reminder
In the qt.quick.hover.trace category, the position is the most
important thing for now. The output for "q" is verbose and usually
there's only one window anyway, so just put the title last, in case
we need to debug a multi-window scenario.
Dealing with hover in multi-device scenarios is going to be interesting
one of these days.
Change-Id: I2b687085432ce2e02ca764b8b4669282e0180c54
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 4dab3b731d..2955b15bca 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2118,6 +2118,7 @@ bool QQuickWindowPrivate::sendHoverEvent(QEvent::Type type, QQuickItem *item, return hoverEvent.isAccepted(); } +// TODO later: specify the device in case of multi-mouse scenario, or mouse and tablet both in use bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &scenePos, const QPointF &lastScenePos, Qt::KeyboardModifiers modifiers, ulong timestamp, bool &accepted) { @@ -2130,7 +2131,12 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce return false; } - qCDebug(DBG_HOVER_TRACE) << q << item << scenePos << lastScenePos << "subtreeHoverEnabled" << itemPrivate->subtreeHoverEnabled; + if (Q_UNLIKELY(DBG_HOVER_TRACE().isDebugEnabled())) { + if (lastScenePos == scenePos) + qCDebug(DBG_HOVER_TRACE) << scenePos << "(unchanged)" << item << "subtreeHoverEnabled" << itemPrivate->subtreeHoverEnabled << "in window" << windowTitle; + else + qCDebug(DBG_HOVER_TRACE) << lastScenePos << "->" << scenePos << item << "subtreeHoverEnabled" << itemPrivate->subtreeHoverEnabled << "in window" << windowTitle; + } if (itemPrivate->subtreeHoverEnabled) { QList<QQuickItem *> children = itemPrivate->paintOrderChildItems(); for (int ii = children.count() - 1; ii >= 0; --ii) { |