aboutsummaryrefslogtreecommitdiffstats
path: root/src/quick/items/qquickevents_p_p.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2016-08-05 15:04:03 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2016-08-05 13:19:26 +0000
commit43db88a5c5614bcab212be1e4703e001f1fbb295 (patch)
tree2f586c80c4d9d78c584c04832d0d44a2d03d2c03 /src/quick/items/qquickevents_p_p.h
parent796b0cf366a6e6ab53fcb096e442261865ca397b (diff)
QQuickEventPoint: replace Qt::TouchPointState with State enum
This allows extension later on, and makes it clear that the state is for any kind of point, not just a touchpoint. Change-Id: I1f8aaa01ea65ac1731645129fedcf7a51ee66e77 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items/qquickevents_p_p.h')
-rw-r--r--src/quick/items/qquickevents_p_p.h15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h
index cda0e87c5e..61bbb4ecda 100644
--- a/src/quick/items/qquickevents_p_p.h
+++ b/src/quick/items/qquickevents_p_p.h
@@ -250,13 +250,22 @@ class Q_QUICK_PRIVATE_EXPORT QQuickEventPoint : public QObject
{
Q_OBJECT
Q_PROPERTY(QPointF scenePos READ scenePos)
- Q_PROPERTY(Qt::TouchPointState state READ state)
+ Q_PROPERTY(State state READ state)
Q_PROPERTY(quint64 pointId READ pointId)
Q_PROPERTY(qreal timeHeld READ timeHeld)
Q_PROPERTY(bool accepted READ isAccepted WRITE setAccepted)
Q_PROPERTY(QQuickItem *grabber READ grabber WRITE setGrabber)
public:
+ enum State {
+ Pressed = Qt::TouchPointPressed,
+ Updated = Qt::TouchPointMoved,
+ Stationary = Qt::TouchPointStationary,
+ Released = Qt::TouchPointReleased
+ // Canceled = Qt::TouchPointReleased << 1 // 0x10 // TODO maybe
+ };
+ Q_ENUM(State)
+
QQuickEventPoint(QQuickPointerEvent *parent);
void reset(Qt::TouchPointState state, QPointF scenePos, quint64 pointId, ulong timestamp);
@@ -265,7 +274,7 @@ public:
QQuickPointerEvent *pointerEvent() const;
QPointF scenePos() const { return m_scenePos; }
- Qt::TouchPointState state() const { return m_state; }
+ State state() const { return m_state; }
quint64 pointId() const { return m_pointId; }
bool isValid() const { return m_valid; }
qreal timeHeld() const { return (m_timestamp - m_pressTimestamp) / 1000.0; }
@@ -280,7 +289,7 @@ private:
QPointer<QQuickItem> m_grabber;
ulong m_timestamp;
ulong m_pressTimestamp;
- Qt::TouchPointState m_state;
+ State m_state;
bool m_valid : 1;
bool m_accept : 1;
int m_reserved : 30;