summaryrefslogtreecommitdiffstats
path: root/tests/manual/qtabletevent/device_information/tabletwidget.h
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@qt.io>2020-06-16 16:43:06 +0200
committerShawn Rutledge <shawn.rutledge@qt.io>2020-06-17 09:12:20 +0200
commit9b72900834a59e07d495fa641526583c2a554840 (patch)
treee837398fa9e7d01771b42f21d2972219c3982681 /tests/manual/qtabletevent/device_information/tabletwidget.h
parent4e145de8a639a3290735f59560141c7dad723af3 (diff)
Update QTabletEvent device_information manual test
- stop using deprecated accessors in QTabletEvent and QMouseEvent - position() and globalPosition() provide high resolution so we don't need to display hi-res global pos separately - keep a pointer to the last-seen QPointingDevice instance rather than copying fields out of it; it will only be deleted if the platform plugin does that (usually only at exit or when it's unplugged) - show seat ID - show platform-specific device ID Change-Id: Ic34e1d1256d6956867992db831c2e66bdda7001e Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'tests/manual/qtabletevent/device_information/tabletwidget.h')
-rw-r--r--tests/manual/qtabletevent/device_information/tabletwidget.h15
1 files changed, 4 insertions, 11 deletions
diff --git a/tests/manual/qtabletevent/device_information/tabletwidget.h b/tests/manual/qtabletevent/device_information/tabletwidget.h
index d05b89a74e..b58442ccda 100644
--- a/tests/manual/qtabletevent/device_information/tabletwidget.h
+++ b/tests/manual/qtabletevent/device_information/tabletwidget.h
@@ -31,6 +31,7 @@
#include <QWidget>
#include <QTabletEvent>
+#include <QPointer>
#include <QPointingDevice>
#include <QShortcut>
@@ -51,27 +52,19 @@ protected:
QString modifiersToString(Qt::KeyboardModifiers m);
private:
void resetAttributes() {
- mDev = QInputDevice::DeviceType::Unknown;
- mPointerType = QPointingDevice::PointerType::Unknown;
- mCaps = {};
+ mDev.clear();
mType = mXT = mYT = mZ = 0;
mPress = mTangential = mRot = 0.0;
mPos = mGPos = QPoint();
- mHiResGlobalPos = QPointF();
- mUnique = 0;
}
+ QPointer<const QPointingDevice> mDev;
int mType;
- QPoint mPos, mGPos;
- QPointF mHiResGlobalPos;
- QInputDevice::DeviceType mDev;
- QPointingDevice::PointerType mPointerType;
- QPointingDevice::Capabilities mCaps;
+ QPointF mPos, mGPos;
int mXT, mYT, mZ;
Qt::MouseButton mButton;
Qt::MouseButtons mButtons;
Qt::KeyboardModifiers mModifiers;
qreal mPress, mTangential, mRot;
- qint64 mUnique;
bool mMouseToo;
ulong mTimestamp;
int mWheelEventCount;