summaryrefslogtreecommitdiff
path: root/src/imports/gestures
diff options
context:
space:
mode:
Diffstat (limited to 'src/imports/gestures')
-rw-r--r--src/imports/gestures/gestures.pro4
-rw-r--r--src/imports/gestures/plugin.cpp5
-rw-r--r--src/imports/gestures/qdeclarativegesturearea.cpp8
-rw-r--r--src/imports/gestures/qdeclarativegesturearea_p.h4
-rw-r--r--src/imports/gestures/qmldir2
5 files changed, 16 insertions, 7 deletions
diff --git a/src/imports/gestures/gestures.pro b/src/imports/gestures/gestures.pro
index f55c00eb02..4ef79319d1 100644
--- a/src/imports/gestures/gestures.pro
+++ b/src/imports/gestures/gestures.pro
@@ -1,4 +1,4 @@
-TARGET = gesturesqmlplugin
+TARGET = qmlgesturesplugin
TARGETPATH = Qt/labs/gestures
include(../qimportbase.pri)
@@ -17,7 +17,7 @@ symbian:{
load(data_caging_paths)
include($$QT_SOURCE_TREE/demos/symbianpkgrules.pri)
- importFiles.sources = gesturesqmlplugin.dll qmldir
+ importFiles.sources = qmlgesturesplugin.dll qmldir
importFiles.path = $$QT_IMPORTS_BASE_DIR/$$TARGETPATH
DEPLOYMENT = importFiles
diff --git a/src/imports/gestures/plugin.cpp b/src/imports/gestures/plugin.cpp
index b8a97515f7..1fc23cab7c 100644
--- a/src/imports/gestures/plugin.cpp
+++ b/src/imports/gestures/plugin.cpp
@@ -53,7 +53,9 @@ public:
virtual void registerTypes(const char *uri)
{
Q_ASSERT(QLatin1String(uri) == QLatin1String("Qt.labs.gestures"));
+#ifndef QT_NO_GESTURES
qmlRegisterCustomType<QDeclarativeGestureArea>(uri,1,0, "GestureArea", new QDeclarativeGestureAreaParser);
+#endif
}
};
@@ -61,5 +63,4 @@ QT_END_NAMESPACE
#include "plugin.moc"
-Q_EXPORT_PLUGIN2(gesturesqmlplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
-
+Q_EXPORT_PLUGIN2(qmlgesturesplugin, QT_PREPEND_NAMESPACE(GestureAreaQmlPlugin));
diff --git a/src/imports/gestures/qdeclarativegesturearea.cpp b/src/imports/gestures/qdeclarativegesturearea.cpp
index 615c6741b8..22be2f1af7 100644
--- a/src/imports/gestures/qdeclarativegesturearea.cpp
+++ b/src/imports/gestures/qdeclarativegesturearea.cpp
@@ -55,6 +55,8 @@
#include <private/qobject_p.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_NAMESPACE
class QDeclarativeGestureAreaPrivate : public QDeclarativeItemPrivate
@@ -226,7 +228,7 @@ void QDeclarativeGestureArea::connectSignals()
ds >> gesturetype;
QString script;
ds >> script;
- QDeclarativeExpression *exp = new QDeclarativeExpression(qmlContext(this), script, 0);
+ QDeclarativeExpression *exp = new QDeclarativeExpression(qmlContext(this), 0, script);
d->bindings.insert(Qt::GestureType(gesturetype),exp);
grabGesture(Qt::GestureType(gesturetype));
}
@@ -259,7 +261,7 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
bool accept = true;
for (Bindings::Iterator it = bindings.begin(); it != bindings.end(); ++it) {
if ((gesture = event->gesture(it.key()))) {
- it.value()->value();
+ it.value()->evaluate();
event->setAccepted(true); // XXX only if value returns true?
}
}
@@ -267,3 +269,5 @@ bool QDeclarativeGestureAreaPrivate::gestureEvent(QGestureEvent *event)
}
QT_END_NAMESPACE
+
+#endif // QT_NO_GESTURES
diff --git a/src/imports/gestures/qdeclarativegesturearea_p.h b/src/imports/gestures/qdeclarativegesturearea_p.h
index 0195511985..ff89166deb 100644
--- a/src/imports/gestures/qdeclarativegesturearea_p.h
+++ b/src/imports/gestures/qdeclarativegesturearea_p.h
@@ -50,6 +50,8 @@
#include <QtCore/qstring.h>
#include <QtGui/qgesture.h>
+#ifndef QT_NO_GESTURES
+
QT_BEGIN_HEADER
QT_BEGIN_NAMESPACE
@@ -97,4 +99,6 @@ QML_DECLARE_TYPE(QDeclarativeGestureArea)
QT_END_HEADER
+#endif // QT_NO_GESTURES
+
#endif
diff --git a/src/imports/gestures/qmldir b/src/imports/gestures/qmldir
index 9d9d587b09..2a31920a40 100644
--- a/src/imports/gestures/qmldir
+++ b/src/imports/gestures/qmldir
@@ -1 +1 @@
-plugin gesturesqmlplugin
+plugin qmlgesturesplugin