From 97e75b2763cd4e36a20a97eaa9a966541add6b6d Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 May 2015 12:22:45 +0200 Subject: Make QTouchDevice a Q_GADGET and introduce Q_ENUM/Q_FLAG. Make it possible to stream the enumerations to a debug stream.# Change-Id: I0add2dcd835333a8d6cebf779252f22c1418faf3 Reviewed-by: Olivier Goffart (Woboq GmbH) Reviewed-by: Shawn Rutledge --- src/gui/kernel/qtouchdevice.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'src/gui/kernel/qtouchdevice.h') diff --git a/src/gui/kernel/qtouchdevice.h b/src/gui/kernel/qtouchdevice.h index f2157ce2d6..90f0f25d2f 100644 --- a/src/gui/kernel/qtouchdevice.h +++ b/src/gui/kernel/qtouchdevice.h @@ -43,11 +43,13 @@ class QTouchDevicePrivate; class Q_GUI_EXPORT QTouchDevice { + Q_GADGET public: enum DeviceType { TouchScreen, TouchPad }; + Q_ENUM(DeviceType) enum CapabilityFlag { Position = 0x0001, @@ -58,6 +60,7 @@ public: NormalizedPosition = 0x0020, MouseEmulation = 0x0040 }; + Q_FLAG(CapabilityFlag) Q_DECLARE_FLAGS(Capabilities, CapabilityFlag) QTouchDevice(); -- cgit v1.2.3 From b0a1a134c2a41b7894f70ed72a4c3f8ddc1066de Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 21 May 2015 13:26:46 +0200 Subject: Add debug operator for QTouchDevice. Produces: QTouchDevice("", type=TouchScreen, capabilities=Position|Area|NormalizedPosition|MouseEmulation, maximumTouchPoints=10) Remove operator from manual test. Change-Id: I6b792665031902d5f822c80807a400a334c27526 Reviewed-by: Shawn Rutledge --- src/gui/kernel/qtouchdevice.h | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/gui/kernel/qtouchdevice.h') diff --git a/src/gui/kernel/qtouchdevice.h b/src/gui/kernel/qtouchdevice.h index 90f0f25d2f..1c1fcc63aa 100644 --- a/src/gui/kernel/qtouchdevice.h +++ b/src/gui/kernel/qtouchdevice.h @@ -38,7 +38,7 @@ QT_BEGIN_NAMESPACE - +class QDebug; class QTouchDevicePrivate; class Q_GUI_EXPORT QTouchDevice @@ -84,6 +84,10 @@ private: Q_DECLARE_OPERATORS_FOR_FLAGS(QTouchDevice::Capabilities) +#ifndef QT_NO_DEBUG_STREAM +Q_GUI_EXPORT QDebug operator<<(QDebug, const QTouchDevice *); +#endif + QT_END_NAMESPACE #endif // QTOUCHDEVICE_H -- cgit v1.2.3