path: root/src/gui/kernel/qtouchdevice_p.h
diff options
authorJan Arve Saether <>2016-08-23 10:44:20 +0200
committerJan Arve Sæther <>2016-10-28 11:07:04 +0000
commit8984c42d1779b13fd29d95274af2d01d32528e52 (patch)
treebf6e75f15c7263ec97c4c41472c4ba5ff16ecb73 /src/gui/kernel/qtouchdevice_p.h
parent780105f9062dec350bbe2a6800c40db3e6382578 (diff)
Combine device and point id into 32 bit point id
This is second attempt of change cd26e66c2e8ddde06b5e22 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) [ChangeLog][QtGui][QTouchEvent][Important Behavior Changes] Touch point ids are now unique even between different devices. As a consequence of that, you cannot anymore assume that QTouchEvent::TouchPoint::id has the same value as given by the native platform nor the same value as given by synthesized touch points. Change-Id: Iad2fd8c6a43ccc571a227a01134a1e8f829dfaf4 Reviewed-by: Frederik Gladhorn <>
Diffstat (limited to 'src/gui/kernel/qtouchdevice_p.h')
1 files changed, 6 insertions, 1 deletions
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),
- { }
+ {
+ 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; }