diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-21 15:30:41 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-21 17:49:44 +0200 |
commit | dd6080ceac38c84581c89c77eb0d7d8285b55c94 (patch) | |
tree | 82777251289164d939ca777e146e89424e1f7329 /src/gui/kernel/qevent.cpp | |
parent | d88de0452a8b5c34a860405d89a43d05447f061e (diff) |
Debug logging support for QNativeGestureEvent
The most useful information is what kind of gesture the event
represents, but it was missing until now.
Also added a line of documentation about the NativeGesture event type.
Change-Id: I1ba3c951dcc5751e937d762d9b647ab0bf8d93b8
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@digia.com>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 1b853411f8..29f9c35356 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3595,6 +3595,12 @@ public: static const int enumIdx = QObject::staticQtMetaObject.indexOfEnumerator("FocusReason"); return QObject::staticQtMetaObject.enumerator(enumIdx).valueToKey(reason); } + + static const char *nativeGestureTypeToString(Qt::NativeGestureType type) + { + static const int enumIdx = QObject::staticQtMetaObject.indexOfEnumerator("NativeGestureType"); + return QObject::staticQtMetaObject.enumerator(enumIdx).valueToKey(type); + } }; } // namespace @@ -3775,7 +3781,8 @@ QDebug operator<<(QDebug dbg, const QEvent *e) # ifndef QT_NO_GESTURES case QEvent::NativeGesture: { const QNativeGestureEvent *ne = static_cast<const QNativeGestureEvent *>(e); - dbg << "QNativeGestureEvent(localPos=" << ne->localPos() << ", value=" << ne->value() << ')'; + dbg << "QNativeGestureEvent(" << DebugHelper::nativeGestureTypeToString(ne->gestureType()) + << "localPos=" << ne->localPos() << ", value=" << ne->value() << ')'; } break; # endif // !QT_NO_GESTURES |