diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-26 12:11:44 +0100 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-03-26 12:10:18 +0000 |
commit | 1fc8f80066aa7131d97ca40c8aada27e7d871379 (patch) | |
tree | 5736189e01eb248db835c9074b9dd7f08feafe7c | |
parent | 38b44229199559ab6476c645633553a5e335a6b3 (diff) | |
download | qttools-1fc8f80066aa7131d97ca40c8aada27e7d871379.tar.gz qttools-1fc8f80066aa7131d97ca40c8aada27e7d871379.tar.bz2 qttools-1fc8f80066aa7131d97ca40c8aada27e7d871379.zip |
qtdiag: Add information on touch devices.
Change-Id: Ibe28292df577bf12311b91952df9034b9636589a
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
-rw-r--r-- | src/qtdiag/qtdiag.cpp | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/qtdiag/qtdiag.cpp b/src/qtdiag/qtdiag.cpp index d5869c05..b710be8c 100644 --- a/src/qtdiag/qtdiag.cpp +++ b/src/qtdiag/qtdiag.cpp @@ -43,6 +43,7 @@ # include <QtGui/QOpenGLFunctions> #endif // QT_NO_OPENGL #include <QtGui/QWindow> +#include <QtGui/QTouchDevice> #ifdef NETWORK_DIAG # include <QSslSocket> @@ -385,6 +386,33 @@ QString qtDiag(unsigned flags) << "\n\n"; } + const QList<const QTouchDevice *> 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"; |