diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-05 15:04:03 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-05 13:19:26 +0000 |
commit | 43db88a5c5614bcab212be1e4703e001f1fbb295 (patch) | |
tree | 2f586c80c4d9d78c584c04832d0d44a2d03d2c03 /src/quick/items/qquickevents.cpp | |
parent | 796b0cf366a6e6ab53fcb096e442261865ca397b (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.cpp')
-rw-r--r-- | src/quick/items/qquickevents.cpp | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index b6e2299f3a..8d8c58beaa 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -509,7 +509,7 @@ void QQuickEventPoint::reset(Qt::TouchPointState state, QPointF scenePos, quint6 m_pointId = pointId; m_valid = true; m_accept = false; - m_state = state; + m_state = static_cast<QQuickEventPoint::State>(state); m_timestamp = timestamp; if (state == Qt::TouchPointPressed) m_pressTimestamp = timestamp; @@ -636,7 +636,7 @@ QQuickEventPoint *QQuickPointerTouchEvent::point(int i) const { QQuickEventPoint::QQuickEventPoint(QQuickPointerEvent *parent) : QObject(parent), m_pointId(0), m_grabber(nullptr), m_timestamp(0), m_pressTimestamp(0), - m_state(Qt::TouchPointReleased), m_valid(false), m_accept(false) + m_state(QQuickEventPoint::Released), m_valid(false), m_accept(false) { Q_UNUSED(m_reserved); } @@ -711,7 +711,7 @@ QVector<QPointF> QQuickPointerEvent::unacceptedPressedPointScenePositions() cons { QVector<QPointF> points; for (int i = 0; i < pointCount(); ++i) { - if (!point(i)->isAccepted() && point(i)->state() == Qt::TouchPointPressed) + if (!point(i)->isAccepted() && point(i)->state() == QQuickEventPoint::Pressed) points << point(i)->scenePos(); } return points; @@ -823,7 +823,7 @@ QTouchEvent *QQuickPointerTouchEvent::touchEventForItem(QQuickItem *item, bool i if (p->isAccepted()) continue; bool isGrabber = p->grabber() == item; - bool isPressInside = p->state() == Qt::TouchPointPressed && item->contains(item->mapFromScene(p->scenePos())); + bool isPressInside = p->state() == QQuickEventPoint::Pressed && item->contains(item->mapFromScene(p->scenePos())); if (!(isGrabber || isPressInside || isFiltering)) continue; |