diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-05-30 14:16:49 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-06-15 06:19:51 +0000 |
commit | 1ef97c39c371f469df932236f9ede4da408734cb (patch) | |
tree | 421fb5f3b5b136f6f314e31c636b7c9078dee69e /src/quick/items | |
parent | a6c0a864751eb017da63317a67bc61541fddb480 (diff) |
categorized logging: trace hover events
Tracing is a kind of logging designed specifically for use with
http://code.qt.io/cgit/qt-labs/umlquick.git, to generate UML
Sequence diagrams. Here it is being used to trace the delivery
of hover events. Due to use of the QT_MESSAGE_PATTERN backtrace
directive, and backtrace splicing, it's not necessary to emit
trace messages for every step: it's mainly important to catch
the final destinations of hover processing, where state is
changed and signals emitted.
Change-Id: I5f640732f90990ef9f89767a56f3978b9c28a410
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickitem.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquickmousearea.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquicktext.cpp | 2 | ||||
-rw-r--r-- | src/quick/items/qquicktextcontrol.cpp | 3 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 3 |
5 files changed, 13 insertions, 0 deletions
diff --git a/src/quick/items/qquickitem.cpp b/src/quick/items/qquickitem.cpp index 1bffaf92d0..17081eca17 100644 --- a/src/quick/items/qquickitem.cpp +++ b/src/quick/items/qquickitem.cpp @@ -86,6 +86,7 @@ QT_BEGIN_NAMESPACE Q_DECLARE_LOGGING_CATEGORY(DBG_MOUSE_TARGET) +Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE) #ifndef QT_NO_DEBUG static const bool qsg_leak_check = !qEnvironmentVariableIsEmpty("QML_LEAK_CHECK"); @@ -7079,6 +7080,7 @@ void QQuickItemPrivate::setHasHoverInChild(bool hasHover) } } + qCDebug(DBG_HOVER_TRACE) << q << hasHoverInChild << "->" << hasHover; hasHoverInChild = hasHover; QQuickItem *parent = q->parentItem(); if (parent) { diff --git a/src/quick/items/qquickmousearea.cpp b/src/quick/items/qquickmousearea.cpp index 0219bc809f..297a57e672 100644 --- a/src/quick/items/qquickmousearea.cpp +++ b/src/quick/items/qquickmousearea.cpp @@ -54,6 +54,8 @@ QT_BEGIN_NAMESPACE DEFINE_BOOL_CONFIG_OPTION(qmlVisualTouchDebugging, QML_VISUAL_TOUCH_DEBUGGING) +Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE) + QQuickMouseAreaPrivate::QQuickMouseAreaPrivate() : enabled(true), scrollGestureEnabled(true), hovered(false), longPress(false), moved(false), stealMouse(false), doubleClick(false), preventStealing(false), @@ -1129,6 +1131,7 @@ void QQuickMouseArea::setHovered(bool h) { Q_D(QQuickMouseArea); if (d->hovered != h) { + qCDebug(DBG_HOVER_TRACE) << this << d->hovered << "->" << h; d->hovered = h; emit hoveredChanged(); d->hovered ? emit entered() : emit exited(); diff --git a/src/quick/items/qquicktext.cpp b/src/quick/items/qquicktext.cpp index 648929c8cd..33f44520fe 100644 --- a/src/quick/items/qquicktext.cpp +++ b/src/quick/items/qquicktext.cpp @@ -69,6 +69,7 @@ QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE) const QChar QQuickTextPrivate::elideChar = QChar(0x2026); @@ -2720,6 +2721,7 @@ QString QQuickText::hoveredLink() const void QQuickTextPrivate::processHoverEvent(QHoverEvent *event) { Q_Q(QQuickText); + qCDebug(DBG_HOVER_TRACE) << q; QString link; if (isLinkHoveredConnected()) { if (event->type() != QEvent::HoverLeave) diff --git a/src/quick/items/qquicktextcontrol.cpp b/src/quick/items/qquicktextcontrol.cpp index 45238e2d0c..ef7485a8e9 100644 --- a/src/quick/items/qquicktextcontrol.cpp +++ b/src/quick/items/qquicktextcontrol.cpp @@ -58,6 +58,7 @@ #include "qtextlist.h" #include "qtextdocumentwriter.h" #include "private/qtextcursor_p.h" +#include <QtCore/qloggingcategory.h> #include <qtextformat.h> #include <qdatetime.h> @@ -76,6 +77,7 @@ const int textCursorWidth = 1; QT_BEGIN_NAMESPACE +Q_DECLARE_LOGGING_CATEGORY(DBG_HOVER_TRACE) #ifndef QT_NO_CONTEXTMENU #endif @@ -1513,6 +1515,7 @@ void QQuickTextControlPrivate::hoverEvent(QHoverEvent *e, const QPointF &pos) hoveredLink = link; emit q->linkHovered(link); } + qCDebug(DBG_HOVER_TRACE) << q << e->type() << pos << "hoveredLink" << hoveredLink; } bool QQuickTextControl::hasImState() const diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index 478e01388e..eb035c571d 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -85,6 +85,7 @@ Q_LOGGING_CATEGORY(DBG_TOUCH, "qt.quick.touch") Q_LOGGING_CATEGORY(DBG_TOUCH_TARGET, "qt.quick.touch.target") Q_LOGGING_CATEGORY(DBG_MOUSE, "qt.quick.mouse") Q_LOGGING_CATEGORY(DBG_MOUSE_TARGET, "qt.quick.mouse.target") +Q_LOGGING_CATEGORY(DBG_HOVER_TRACE, "qt.quick.hover.trace") Q_LOGGING_CATEGORY(DBG_FOCUS, "qt.quick.focus") Q_LOGGING_CATEGORY(DBG_DIRTY, "qt.quick.dirty") @@ -1751,6 +1752,7 @@ void QQuickWindow::mouseMoveEvent(QMouseEvent *event) } qCDebug(DBG_MOUSE) << "QQuickWindow::mouseMoveEvent()" << event->localPos() << event->button() << event->buttons(); + qCDebug(DBG_HOVER_TRACE) << this; #ifndef QT_NO_CURSOR d->updateCursor(event->windowPos()); @@ -1787,6 +1789,7 @@ bool QQuickWindowPrivate::deliverHoverEvent(QQuickItem *item, const QPointF &sce return false; } + qCDebug(DBG_HOVER_TRACE) << q << item << scenePos << lastScenePos << "hasHoverInChild" << itemPrivate->hasHoverInChild; if (itemPrivate->hasHoverInChild) { QList<QQuickItem *> children = itemPrivate->paintOrderChildItems(); for (int ii = children.count() - 1; ii >= 0; --ii) { |