From 94dfb18865fc4694f5e9cd1e3e3e5dc49fb3aea3 Mon Sep 17 00:00:00 2001 From: Shawn Rutledge Date: Fri, 4 Dec 2020 07:21:40 +0100 Subject: [PATCH] Make qDebug output for QTabletEvent similar to that for QMouseEvent Reuse operator<<(QPointingDevice*) and move the button state right after the event type. Now it's easier to follow when a QTabletEvent is not accepted and a mouse event is synthesized: qt.quick.pointer QQuickWindowPrivate::deliverPointerEvent - delivering QTabletEvent(TabletPress LeftButton pos=100,100 z=3 xTilt=25 yTilt=35 pressure=0.5 dev=QPointingDevice("Wacom Intuos3 6x8 Pen stylus" Stylus id=13 seat=30002 ptrType=Pen caps=Position|Pressure|MouseEmulation|Hover|XTilt|YTilt uniqueId=499602d2)) qt.quick.pointer QQuickWindowPrivate::deliverPointerEvent - delivering QMouseEvent(MouseButtonPress LeftButton pos=100,100 scn=100,100 gbl=3739,1029 dev=QPointingDevice("Wacom Intuos3 6x8 Pen stylus" Stylus id=13 seat=30002 ptrType=Pen caps=Position|Pressure|MouseEmulation|Hover|XTilt|YTilt uniqueId=499602d2)) Change-Id: If22f1c07d32f595d0444513b49635218c08a300d Reviewed-by: Volker Hilsheimer --- src/gui/kernel/qevent.cpp | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 0caba17ddd..edf00928eb 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -3896,23 +3896,20 @@ static void formatTabletEvent(QDebug d, const QTabletEvent *e) d << eventClassName(type) << '('; QtDebugUtils::formatQEnum(d, type); - d << " deviceType="; - QtDebugUtils::formatQEnum(d, e->deviceType()); - d << " pointerType="; - QtDebugUtils::formatQEnum(d, e->pointerType()); - d << " uniqueId=" << e->pointingDevice()->uniqueId().numericId() - << " pos=" << e->position() - << " z=" << e->z() - << " xTilt=" << e->xTilt() - << " yTilt=" << e->yTilt() - << " "; + d << ' '; QtDebugUtils::formatQFlags(d, e->buttons()); + d << " pos="; + QtDebugUtils::formatQPoint(d, e->position()); + d << " z=" << e->z() + << " xTilt=" << e->xTilt() + << " yTilt=" << e->yTilt(); if (type == QEvent::TabletPress || type == QEvent::TabletMove) d << " pressure=" << e->pressure(); if (e->device()->hasCapability(QInputDevice::Capability::Rotation)) d << " rotation=" << e->rotation(); if (e->deviceType() == QInputDevice::DeviceType::Airbrush) d << " tangentialPressure=" << e->tangentialPressure(); + d << " dev=" << e->device() << ')'; } # endif // QT_CONFIG(tabletevent)