From cd26e66c2e8ddde06b5e22ef28d815ac1082a7c4 Mon Sep 17 00:00:00 2001 From: Jan Arve Saether Date: Tue, 23 Aug 2016 10:44:20 +0200 Subject: Combine device and point id into 32 bit point id This allows us to not have conflicts between the point ids between different devices for QtQuick pointer handlers. We do this in QtGui because we can then safely compare point ids from QTouchEvent::TouchPoint and QQuickEventPoint. (Point ids that QtQuick pointer handlers use will be based on the point ids provided by QTouchEvent::TouchPoint::id) Change-Id: I8b9ab0d44224b15175b820d33cbb2d8bd21e99f2 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qtouchdevice_p.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qtouchdevice_p.h') diff --git a/src/gui/kernel/qtouchdevice_p.h b/src/gui/kernel/qtouchdevice_p.h index 203d9fca74..18d2af46a7 100644 --- a/src/gui/kernel/qtouchdevice_p.h +++ b/src/gui/kernel/qtouchdevice_p.h @@ -64,16 +64,21 @@ public: : type(QTouchDevice::TouchScreen), caps(QTouchDevice::Position), maxTouchPoints(1) - { } + { + static quint8 nextId = 2; // device 0 is not used, device 1 is for mouse device + id = nextId++; + } QTouchDevice::DeviceType type; QTouchDevice::Capabilities caps; QString name; int maxTouchPoints; + quint8 id; static void registerDevice(const QTouchDevice *dev); static void unregisterDevice(const QTouchDevice *dev); static bool isRegistered(const QTouchDevice *dev); + static QTouchDevicePrivate *get(QTouchDevice *q) { return q->d; } }; QT_END_NAMESPACE -- cgit v1.2.3