diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-07-15 13:34:08 +0200 |
---|---|---|
committer | Frederik Gladhorn <frederik.gladhorn@qt.io> | 2016-07-26 10:20:33 +0000 |
commit | 65156eace79562e8a4043268eb293fd4d1e14476 (patch) | |
tree | 36de10d1dbdb4e0905660706f739abc0b6f6a363 /src/quick/items | |
parent | 9d292aef75cbef15c5506bd69f5e6defa59499b0 (diff) |
Add QQuickPointerEvent::unacceptedPointScenePositions
Returns a list of scene points for all points that have not been
accepted yet.
Change-Id: I218e0c779d236e1b5d7d16fe1537adf454b94035
Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickevents.cpp | 10 | ||||
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 1 |
2 files changed, 11 insertions, 0 deletions
diff --git a/src/quick/items/qquickevents.cpp b/src/quick/items/qquickevents.cpp index 709ba9e69d..a83f86017f 100644 --- a/src/quick/items/qquickevents.cpp +++ b/src/quick/items/qquickevents.cpp @@ -652,6 +652,16 @@ void QQuickPointerTouchEvent::clearGrabbers() const { point(i)->setGrabber(nullptr); } +QVector<QPointF> QQuickPointerEvent::unacceptedPointScenePositions() const +{ + QVector<QPointF> points; + for (int i = 0; i < pointCount(); ++i) { + if (!point(i)->isAccepted()) + points << point(i)->scenePos(); + } + return points; +} + /*! \internal Populate the reusable synth-mouse event from one touchpoint. diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index ef6bba50ed..5c3d6f105a 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -360,6 +360,7 @@ public: // helpers for C++ only (during event delivery) virtual const QQuickPointerTabletEvent *asPointerTabletEvent() const { return nullptr; } bool isValid() const { return m_event != nullptr; } virtual bool allPointsAccepted() const = 0; + QVector<QPointF> unacceptedPointScenePositions() const; virtual int pointCount() const = 0; virtual QQuickEventPoint *point(int i) const = 0; |