summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qgesture_p.h
diff options
context:
space:
mode:
authorDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-06-15 14:00:46 (GMT)
committerDenis Dzyubenko <denis.dzyubenko@nokia.com>2009-07-02 15:16:07 (GMT)
commit60e965fd35037f4a27816d2aeccafdff0d6ae9d6 (patch)
tree8a968022a03057cc29aa3f7cc246ee708d869b8a /src/gui/kernel/qgesture_p.h
parent099a32d121cbc80a1a234c3146f4be9b5237e7e8 (diff)
downloadQt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.zip
Qt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.tar.gz
Qt-60e965fd35037f4a27816d2aeccafdff0d6ae9d6.tar.bz2
Refactored gesture api
Rewritten the api almost from scratch, making it simplier and more flexible at the same time. The current implementation will not have complex gseturemanager class inside Qt, but the QGesture base class, which represents both a gesture recognizer and a gesture itself with a set of properties. A set of common gestures that can use used in third-party applications (and in Qt itself internally) is supposed to be found in qstandardgestures.h, and a base class for user-defined gestures is in qgesture.h Gesture implementation for Pan on Windows7 has also been added as a reference implementation for platform gestures.
Diffstat (limited to 'src/gui/kernel/qgesture_p.h')
-rw-r--r--src/gui/kernel/qgesture_p.h35
1 files changed, 9 insertions, 26 deletions
diff --git a/src/gui/kernel/qgesture_p.h b/src/gui/kernel/qgesture_p.h
index caf851e..99f572f 100644
--- a/src/gui/kernel/qgesture_p.h
+++ b/src/gui/kernel/qgesture_p.h
@@ -56,10 +56,12 @@
#include "qrect.h"
#include "qpoint.h"
#include "qdatetime.h"
+#include "qgesture.h"
#include "private/qobject_p.h"
QT_BEGIN_NAMESPACE
+class QObject;
class QGraphicsItem;
class QGesturePrivate : public QObjectPrivate
{
@@ -67,47 +69,28 @@ class QGesturePrivate : public QObjectPrivate
public:
QGesturePrivate()
- : state(Qt::NoGesture), graphicsItem(0), singleshot(0), duration(0) { }
+ : graphicsItem(0), eventFilterProxyGraphicsItem(0), state(Qt::NoGesture)
+ {
+ }
void init(const QPoint &startPos, const QPoint &lastPos,
- const QPoint &pos, const QRect &rect,
- const QPoint &hotSpot, const QDateTime &startTime,
- uint duration)
+ const QPoint &pos)
{
- this->rect = rect;
- this->hotSpot = hotSpot;
- this->startTime = startTime;
- this->duration = duration;
this->startPos = startPos;
this->lastPos = lastPos;
this->pos = pos;
}
- QString type;
- Qt::GestureState state;
-
- QPointer<QWidget> widget;
QGraphicsItem *graphicsItem;
- uint singleshot:1;
+ QGraphicsItem *eventFilterProxyGraphicsItem;
+
+ Qt::GestureState state;
- QRect rect;
- QPoint hotSpot;
- QDateTime startTime;
- uint duration;
QPoint startPos;
QPoint lastPos;
QPoint pos;
};
-class QPanningGesturePrivate : public QGesturePrivate
-{
- Q_DECLARE_PUBLIC(QPanningGesture)
-
-public:
- Qt::DirectionType lastDirection;
- Qt::DirectionType direction;
-};
-
QT_END_NAMESPACE
#endif // QGESTURE_P_H