diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-07-11 16:19:52 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-07-12 12:43:06 +0000 |
commit | 14e8e05ce3511e46d30710a680b0b7e987a569c7 (patch) | |
tree | e25ad4a4dd0a0637ae6819c86b8c801ecc3515dc /src/quick/items/qquickevents_p_p.h | |
parent | ccad62088a80fa33cedba58adb633d27055e87b6 (diff) |
add QQuickPointerEvent::touchEventForItem
It's similar to QQuickWindowPrivate::touchEventWithPoints(), and is
used in the same way when delivering a QQuickPointerEvent by sending
a QTouchEvent to the item's event() method.
Change-Id: I0d181eaf924bfdad2db2de9d8acf85d0345aec3e
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.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index c4c4daf830..af3e385ce6 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -378,6 +378,8 @@ private: QPointerUniqueId m_uniqueId; }; +class QQuickItem; + class Q_QUICK_PRIVATE_EXPORT QQuickPointerEvent : public QObject { Q_OBJECT @@ -406,6 +408,9 @@ public: Qt::MouseButton button() const { return m_button; } Qt::MouseButtons buttons() const { return m_pressedButtons; } + // ---------------------------------------------------- + // helpers for C++ event delivery, not for QML properties + /** Returns the original touch event. */ QTouchEvent *asTouchEvent() const; @@ -414,7 +419,6 @@ public: * Returns nullptr in case the original event was not a mouse event. */ QMouseEvent *asMouseEvent() const; - // helpers for C++ event delivery, not for QML properties int pointCount() const { return asTouchEvent() ? m_touchPoints.count() : 1; } const QQuickEventPoint *point(int i) const { if (asTouchEvent()) @@ -422,6 +426,10 @@ public: return i == 0 ? m_mousePoint : nullptr; } + const QTouchEvent::TouchPoint *touchPointById(int pointId) const; + + QTouchEvent *touchEventForItem(const QList<const QQuickEventPoint *> &newPoints, QQuickItem *relativeTo) const; + protected: bool isValid() const { return m_event != nullptr; } |