diff options
author | Friedemann Kleint <Friedemann.Kleint@digia.com> | 2014-06-13 11:59:50 +0200 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-06-16 10:35:07 +0200 |
commit | 4b8a81f52516d59801637520533cb298aeb802e7 (patch) | |
tree | 076aa88db122d51782a977d695fe8d8902d1a08e /src/gui/kernel/qevent.cpp | |
parent | bc96954aef67246bf90e51328eae8f96f03fd74e (diff) |
Improve debug output of events.
Change-Id: Ifc9817ca34a85cc7d9bd17dba9828249116fa0f6
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 52 |
1 files changed, 42 insertions, 10 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index bb7000a266..78e61058d1 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3302,6 +3302,8 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { << ", " << hex << (int)me->modifiers() << dec; if (const Qt::MouseEventSource source = me->source()) nsp << ", source = " << source; + if (const Qt::MouseEventFlags flags = me->flags()) + nsp << ", flags = " << hex << int(flags) << dec; nsp << ')'; } return dbg.space(); @@ -3355,11 +3357,13 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { } return dbg.space(); case QEvent::FocusIn: - n = "FocusIn"; - break; + dbg.nospace() << "QFocusEvent(FocusIn, reason=" + << static_cast<const QFocusEvent *>(e)->reason() << ')'; + return dbg.space(); case QEvent::FocusOut: - n = "FocusOut"; - break; + dbg.nospace() << "QFocusEvent(FocusOut, reason=" + << static_cast<const QFocusEvent *>(e)->reason() << ')'; + return dbg.space(); case QEvent::Enter: n = "Enter"; break; @@ -3381,12 +3385,24 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { case QEvent::Paint: n = "Paint"; break; - case QEvent::Move: - n = "Move"; - break; - case QEvent::Resize: - n = "Resize"; - break; + case QEvent::Move: { + const QMoveEvent *me = static_cast<const QMoveEvent *>(e); + QDebug nospace = dbg.nospace(); + nospace << "QMoveEvent(" << me->pos(); + if (!me->spontaneous()) + nospace << ", non-spontaneous"; + nospace << ')'; + } + return dbg.space(); + case QEvent::Resize: { + const QResizeEvent *re = static_cast<const QResizeEvent *>(e); + QDebug nospace = dbg.nospace(); + nospace << "QResizeEvent(" << re->size(); + if (!re->spontaneous()) + nospace << ", non-spontaneous"; + nospace << ')'; + } + return dbg.space(); case QEvent::Create: n = "Create"; break; @@ -3551,7 +3567,23 @@ QDebug operator<<(QDebug dbg, const QEvent *e) { case QEvent::Gesture: n = "Gesture"; break; + case QEvent::GestureOverride: + n = "GestureOverride"; + break; #endif + case QEvent::MetaCall: + n = "MetaCall"; + break; + case QEvent::ApplicationStateChange: + dbg.nospace() << "QApplicationStateChangeEvent(" + << static_cast<const QApplicationStateChangeEvent *>(e)->applicationState() << ')'; + return dbg.space(); + case QEvent::WindowTitleChange: + n = "WindowTitleChange"; + break; + case QEvent::Expose: + n = "Expose"; + break; default: dbg.nospace() << "QEvent(" << (const void *)e << ", type = " << e->type() << ')'; return dbg.space(); |