diff options
-rw-r--r-- | src/corelib/global/qnamespace.h | 1 | ||||
-rw-r--r-- | src/corelib/kernel/qcoreevent.cpp | 1 | ||||
-rw-r--r-- | src/gui/kernel/qevent.cpp | 9 |
3 files changed, 10 insertions, 1 deletions
diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index 485193b071..0da868602c 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -98,6 +98,7 @@ Qt { #ifndef QT_NO_GESTURES Q_ENUMS(GestureState) Q_ENUMS(GestureType) + Q_ENUMS(NativeGestureType) #endif Q_ENUMS(CursorMoveStyle) Q_ENUMS(TimerType) diff --git a/src/corelib/kernel/qcoreevent.cpp b/src/corelib/kernel/qcoreevent.cpp index 8d5a39115a..bc54a2ae74 100644 --- a/src/corelib/kernel/qcoreevent.cpp +++ b/src/corelib/kernel/qcoreevent.cpp @@ -184,6 +184,7 @@ QT_BEGIN_NAMESPACE \value MouseMove Mouse move (QMouseEvent). \value MouseTrackingChange The mouse tracking state has changed. \value Move Widget's position changed (QMoveEvent). + \value NativeGesture The system has detected a gesture (QNativeGestureEvent). \value OrientationChange The screens orientation has changes (QScreenOrientationChangeEvent) \value Paint Screen update necessary (QPaintEvent). \value PaletteChange Palette of the widget changed. 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 |