From 1fc8f80066aa7131d97ca40c8aada27e7d871379 Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 26 Mar 2015 12:11:44 +0100 Subject: qtdiag: Add information on touch devices. Change-Id: Ibe28292df577bf12311b91952df9034b9636589a Reviewed-by: Alex Blasche --- src/qtdiag/qtdiag.cpp | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp index d5869c057..b710be8c6 100644 --- a/src/qtdiag/qtdiag.cpp +++ b/src/qtdiag/qtdiag.cpp @@ -43,6 +43,7 @@ # include #endif // QT_NO_OPENGL #include +#include #ifdef NETWORK_DIAG # include @@ -385,6 +386,33 @@ QString qtDiag(unsigned flags) << "\n\n"; } + const QList touchDevices = QTouchDevice::devices(); + if (!touchDevices.isEmpty()) { + str << "Touch devices: " << touchDevices.size() << '\n'; + foreach (const QTouchDevice *device, touchDevices) { + str << " " << (device->type() == QTouchDevice::TouchScreen ? "TouchScreen" : "TouchPad") + << " \"" << device->name() << "\", max " << device->maximumTouchPoints() + << " touch points, capabilities:"; + const QTouchDevice::Capabilities capabilities = device->capabilities(); + if (capabilities & QTouchDevice::Position) + str << " Position"; + if (capabilities & QTouchDevice::Area) + str << " Area"; + if (capabilities & QTouchDevice::Pressure) + str << " Pressure"; + if (capabilities & QTouchDevice::Velocity) + str << " Velocity"; + if (capabilities & QTouchDevice::RawPositions) + str << " RawPositions"; + if (capabilities & QTouchDevice::NormalizedPosition) + str << " NormalizedPosition"; + if (capabilities & QTouchDevice::MouseEmulation) + str << " MouseEmulation"; + str << '\n'; + } + str << "\n\n"; + } + #ifndef QT_NO_OPENGL dumpGlInfo(str, flags & QtDiagGlExtensions); str << "\n\n"; -- cgit v1.2.3