diff options
author | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-05-21 13:26:46 +0200 |
---|---|---|
committer | Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> | 2015-05-22 04:36:41 +0000 |
commit | b0a1a134c2a41b7894f70ed72a4c3f8ddc1066de (patch) | |
tree | 640e2cae6272366fcfe7359c99ffac2fa9d0cf81 /src/gui/kernel/qtouchdevice.cpp | |
parent | 97e75b2763cd4e36a20a97eaa9a966541add6b6d (diff) |
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 <shawn.rutledge@digia.com>
Diffstat (limited to 'src/gui/kernel/qtouchdevice.cpp')
-rw-r--r-- | src/gui/kernel/qtouchdevice.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/gui/kernel/qtouchdevice.cpp b/src/gui/kernel/qtouchdevice.cpp index 8737825de0..1a6e9deba8 100644 --- a/src/gui/kernel/qtouchdevice.cpp +++ b/src/gui/kernel/qtouchdevice.cpp @@ -37,6 +37,8 @@ #include <QMutex> #include <QCoreApplication> +#include <private/qdebug_p.h> + QT_BEGIN_NAMESPACE /*! @@ -239,4 +241,25 @@ void QTouchDevicePrivate::registerDevice(QTouchDevice *dev) deviceList()->append(dev); } +#ifndef QT_NO_DEBUG_STREAM +QDebug operator<<(QDebug debug, const QTouchDevice *device) +{ + QDebugStateSaver saver(debug); + debug.nospace(); + debug.noquote(); + debug << "QTouchDevice("; + if (device) { + debug << '"' << device->name() << "\", type="; + QtDebugUtils::formatQEnum(debug, device->type()); + debug << ", capabilities="; + QtDebugUtils::formatQFlags(debug, device->capabilities()); + debug << ", maximumTouchPoints=" << device->maximumTouchPoints(); + } else { + debug << '0'; + } + debug << ')'; + return debug; +} +#endif // !QT_NO_DEBUG_STREAM + QT_END_NAMESPACE |