summaryrefslogtreecommitdiffstats
path: root/examples/gestures/imageviewer/tapandholdgesture.h
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-03 15:02:58 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-08-04 14:22:46 (GMT)
commit6b85ec8790aad8ac01c04f7e7bd4913d8cd8d104 (patch)
treeb45584416ababa562478ca35a7f2ef2c63936942 /examples/gestures/imageviewer/tapandholdgesture.h
parent6e7a6478279a94a82af46e6814f113244aca46dd (diff)
downloadQt-6b85ec8790aad8ac01c04f7e7bd4913d8cd8d104.zip
Qt-6b85ec8790aad8ac01c04f7e7bd4913d8cd8d104.tar.gz
Qt-6b85ec8790aad8ac01c04f7e7bd4913d8cd8d104.tar.bz2
Removed the QTapAndHoldGesture
Moved the gesture implementation to the imageviewer example as it cannot be fully implemented in a crossplatform way - for example on Windows tap and hold is a system gesture that is transparent to the application. Reviewed-by: trustme
Diffstat (limited to 'examples/gestures/imageviewer/tapandholdgesture.h')
-rw-r--r--examples/gestures/imageviewer/tapandholdgesture.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/examples/gestures/imageviewer/tapandholdgesture.h b/examples/gestures/imageviewer/tapandholdgesture.h
new file mode 100644
index 0000000..711a1af
--- /dev/null
+++ b/examples/gestures/imageviewer/tapandholdgesture.h
@@ -0,0 +1,32 @@
+#ifndef TAPANDHOLDGESTURE_H
+#define TAPANDHOLDGESTURE_H
+
+#include <QtCore/QBasicTimer>
+#include <QtGui/QGesture>
+#include <QtGui/QWidget>
+
+class TapAndHoldGesture : public QGesture
+{
+ Q_OBJECT
+ Q_PROPERTY(QPoint pos READ pos)
+
+public:
+ TapAndHoldGesture(QWidget *parent);
+
+ bool filterEvent(QEvent *event);
+ void reset();
+
+ QPoint pos() const;
+
+protected:
+ void timerEvent(QTimerEvent *event);
+
+private:
+ QBasicTimer timer;
+ int iteration;
+ QPoint position;
+ static const int iterationCount;
+ static const int iterationTimeout;
+};
+
+#endif // TAPANDHOLDGESTURE_H