diff options
author | Liang Qi <liang.qi@qt.io> | 2017-05-19 08:56:40 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2017-05-19 08:56:40 +0200 |
commit | 880b0d741477a56440cb3c2b57294b6748dbfd4c (patch) | |
tree | bb771541462ff1c7d899671510c9a2f653209cf6 /src/quick/items | |
parent | 43d34fd6f96ed6b07fe79cf1637d5ec66cc97f4f (diff) | |
parent | ee6b07b3ce8ba80632868181d45d96253acb1064 (diff) |
Merge remote-tracking branch 'origin/5.9.0' into 5.9
Change-Id: I52c591fff08a0cbf426aa53354850fb4b5f130c1
Diffstat (limited to 'src/quick/items')
-rw-r--r-- | src/quick/items/qquickevents_p_p.h | 7 | ||||
-rw-r--r-- | src/quick/items/qquickwindow.cpp | 5 |
2 files changed, 11 insertions, 1 deletions
diff --git a/src/quick/items/qquickevents_p_p.h b/src/quick/items/qquickevents_p_p.h index 3735d68a85..323ecfa4ff 100644 --- a/src/quick/items/qquickevents_p_p.h +++ b/src/quick/items/qquickevents_p_p.h @@ -501,6 +501,7 @@ public: : m_deviceType(devType), m_pointerType(pType), m_capabilities(caps) , m_maximumTouchPoints(maxPoints), m_buttonCount(buttonCount), m_name(name) , m_uniqueId(QPointingDeviceUniqueId::fromNumericId(uniqueId)) + , m_event(nullptr) { } @@ -513,6 +514,8 @@ public: QString name() const { return m_name; } QPointingDeviceUniqueId uniqueId() const { return m_uniqueId; } + QQuickPointerEvent *pointerEvent() const { return m_event; } // deprecated + static QQuickPointerDevice *touchDevice(QTouchDevice *d); static QList<QQuickPointerDevice *> touchDevices(); static QQuickPointerDevice *genericMouseDevice(); @@ -527,6 +530,10 @@ private: QString m_name; QPointingDeviceUniqueId m_uniqueId; + // the event instance used last time within the context of one window + QQuickPointerEvent *m_event; // deprecated + friend class QQuickWindowPrivate; // not needed after removing the above + Q_DISABLE_COPY(QQuickPointerDevice) }; diff --git a/src/quick/items/qquickwindow.cpp b/src/quick/items/qquickwindow.cpp index ff4a357641..67069c7d15 100644 --- a/src/quick/items/qquickwindow.cpp +++ b/src/quick/items/qquickwindow.cpp @@ -2117,8 +2117,10 @@ QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevic { // the list of devices should be very small so a linear search should be ok for (QQuickPointerEvent *e: pointerEventInstances) { - if (e->device() == device) + if (e->device() == device) { + device->m_event = e; return e; + } } QQuickPointerEvent *ev = nullptr; @@ -2136,6 +2138,7 @@ QQuickPointerEvent *QQuickWindowPrivate::pointerEventInstance(QQuickPointerDevic break; } pointerEventInstances << ev; + device->m_event = ev; return ev; } |