From 1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Thu, 22 Jul 2010 16:22:07 +0200 Subject: Register a few gesture-related types in the meta-type system. Reviewed-by: Zeno Albisser Reviewed-by: Volker Hilsheimer --- src/corelib/global/qnamespace.h | 3 +++ src/gui/kernel/qgesture.h | 3 +++ src/imports/gestures/plugin.cpp | 7 +++++++ 3 files changed, 13 insertions(+) diff --git a/src/corelib/global/qnamespace.h b/src/corelib/global/qnamespace.h index a12e121..68702c4 100644 --- a/src/corelib/global/qnamespace.h +++ b/src/corelib/global/qnamespace.h @@ -90,6 +90,9 @@ Qt { Q_ENUMS(InputMethodHint) Q_FLAGS(WindowFlags WindowStates InputMethodHints) Q_ENUMS(ConnectionType) +#ifndef QT_NO_GESTURES + Q_ENUMS(GestureState) +#endif #endif // (defined(Q_MOC_RUN) || defined(QT_JAMBI_RUN)) #if defined(Q_MOC_RUN) diff --git a/src/gui/kernel/qgesture.h b/src/gui/kernel/qgesture.h index 8f410b1..dcb0264 100644 --- a/src/gui/kernel/qgesture.h +++ b/src/gui/kernel/qgesture.h @@ -134,6 +134,7 @@ class Q_GUI_EXPORT QPinchGesture : public QGesture { Q_OBJECT Q_DECLARE_PRIVATE(QPinchGesture) + Q_FLAGS(ChangeFlags ChangeFlag) public: enum ChangeFlag { @@ -191,6 +192,8 @@ public: friend class QPinchGestureRecognizer; }; +Q_DECLARE_OPERATORS_FOR_FLAGS(QPinchGesture::ChangeFlags) + QT_END_NAMESPACE Q_DECLARE_METATYPE(QPinchGesture::ChangeFlags) diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp index 1fc23ca..8f85553 100644 --- a/src/imports/gestures/plugin.cpp +++ b/src/imports/gestures/plugin.cpp @@ -55,6 +55,13 @@ public: Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures")); #ifndef QT_NO_GESTURES qmlRegisterCustomType(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser); + + qmlRegisterUncreatableType(uri, 1, 0, "Gesture", QLatin1String("Do not create objects of this type.")); + qmlRegisterUncreatableType(uri, 1, 0, "PanGesture", QLatin1String("Do not create objects of this type.")); + qmlRegisterUncreatableType(uri, 1, 0, "TapGesture", QLatin1String("Do not create objects of this type.")); + qmlRegisterUncreatableType(uri, 1, 0, "TapAndHoldGesture", QLatin1String("Do not create objects of this type.")); + qmlRegisterUncreatableType(uri, 1, 0, "PinchGesture", QLatin1String("Do not create objects of this type.")); + qmlRegisterUncreatableType(uri, 1, 0, "SwipeGesture", QLatin1String("Do not create objects of this type.")); #endif } }; -- cgit v0.12