diff options
author | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-04 12:57:55 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@digia.com> | 2014-08-05 17:00:45 +0200 |
commit | d7fea8e5d2146af4df40b136c8265287f3a8a8c5 (patch) | |
tree | 39b58f91e8020e2ed538edb35bab04d8a7b6459a /src/gui/kernel/qevent.cpp | |
parent | 27b67c5399bc068b4bff34dc53b07b0f6b277617 (diff) |
Improve qDebug output for QTabletEvent
Change-Id: Ic2819eaa5ed0e3666062f00994b72dee0b2cba66
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 5f009e75fa..457428f569 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3622,10 +3622,27 @@ static void formatDropEvent(QDebug d, const QDropEvent *e) static void formatTabletEvent(QDebug d, const QTabletEvent *e) { const QEvent::Type type = e->type(); - d << eventClassName(type) << '(' << eventTypeName(type) << ", pos=" << e->posF() - << ", pointerType=" << e->pointerType() - << ", pressure=" << e->pressure() << ", rotation=" << e->rotation() + + static const int deviceEnumIdx = QTabletEvent::staticMetaObject.indexOfEnumerator("TabletDevice"); + static const int pointerTypeEnumIdx = QTabletEvent::staticMetaObject.indexOfEnumerator("PointerType"); + const char* device = QTabletEvent::staticMetaObject.enumerator(deviceEnumIdx).valueToKey(e->device()); + const char* pointerType = QTabletEvent::staticMetaObject.enumerator(pointerTypeEnumIdx).valueToKey(e->pointerType()); + + d << eventClassName(type) << '(' << eventTypeName(type) + << ", device=" << device + << ", pointerType=" << pointerType + << ", uniqueId=" << e->uniqueId() + << ", pos=" << e->posF() + << ", z=" << e->z() + << ", xTilt=" << e->xTilt() + << ", yTilt=" << e->yTilt() << ", " << DebugHelper::mouseButtonsToString(e->buttons()).constData(); + if (type == QEvent::TabletPress || type == QEvent::TabletMove) + d << ", pressure=" << e->pressure(); + if (e->device() == QTabletEvent::RotationStylus || e->device() == QTabletEvent::FourDMouse) + d << ", rotation=" << e->rotation(); + if (e->device() == QTabletEvent::Airbrush) + d << ", tangentialPressure=" << e->tangentialPressure(); } # endif // !QT_NO_TABLETEVENT |