summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-07-22 14:22:07 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2010-07-23 09:46:39 (GMT)
commit1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d (patch)
treeafd461ed65ac6cc7861053957e918c4d9d9facbe /src
parent5e0371250d050f619d3c7c635377213ece733e66 (diff)
downloadQt-1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d.zip
Qt-1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d.tar.gz
Qt-1e42dc7e2421969a5a941d15d425eaf4d8bf3f7d.tar.bz2
Register a few gesture-related types in the meta-type system.
Reviewed-by: Zeno Albisser Reviewed-by: Volker Hilsheimer
Diffstat (limited to 'src')
-rw-r--r--src/corelib/global/qnamespace.h3
-rw-r--r--src/gui/kernel/qgesture.h3
-rw-r--r--src/imports/gestures/plugin.cpp7
3 files changed, 13 insertions, 0 deletions
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<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
+
+ qmlRegisterUncreatableType<QGesture>(uri, 1, 0, "Gesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QPanGesture>(uri, 1, 0, "PanGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QTapGesture>(uri, 1, 0, "TapGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QTapAndHoldGesture>(uri, 1, 0, "TapAndHoldGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QPinchGesture>(uri, 1, 0, "PinchGesture", QLatin1String("Do not create objects of this type."));
+ qmlRegisterUncreatableType<QSwipeGesture>(uri, 1, 0, "SwipeGesture", QLatin1String("Do not create objects of this type."));
#endif
}
};