diff options
author | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-14 17:11:13 +0100 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2020-02-17 21:39:59 +0100 |
commit | 882f340f62b8dc34633f5f296be12243b6e8999d (patch) | |
tree | 5f2b5afc5edfe08c9e1ca3093cb211fc3b142533 /src | |
parent | 352c8ef1997542de2d471a8d929442529b876263 (diff) |
Deprecate QTabletEvent::device() in favor of deviceType()
The idea is to reserve device() to return a pointer to a QInputDevice
in the future, which is in sync with QQuickPointerEvent::device()
and with QTouchEvent::device().
Change-Id: Ifda6e8aea72d5121955b31bdcbd91bf1bfa4cec4
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 6 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 4 | ||||
-rw-r--r-- | src/widgets/kernel/qapplication.cpp | 2 |
3 files changed, 10 insertions, 2 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 8360ada429..069f4b1a3c 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -2454,6 +2454,12 @@ Qt::MouseButtons QTabletEvent::buttons() const /*! \fn TabletDevices QTabletEvent::device() const + \deprecated Use deviceType(). +*/ + +/*! + \fn TabletDevices QTabletEvent::deviceType() const + Returns the type of device that generated the event. \sa TabletDevice diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index 1921cabb83..cf596d8d45 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -312,8 +312,10 @@ public: inline qreal hiResGlobalX() const { return mGPos.x(); } QT_DEPRECATED_VERSION_X_5_15("use globalPosF().y()") inline qreal hiResGlobalY() const { return mGPos.y(); } -#endif + QT_DEPRECATED_VERSION_X_5_15("Use deviceType()") inline TabletDevice device() const { return TabletDevice(mDev); } +#endif + inline TabletDevice deviceType() const { return TabletDevice(mDev); } inline PointerType pointerType() const { return PointerType(mPointerType); } inline qint64 uniqueId() const { return mUnique; } inline qreal pressure() const { return mPress; } diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp index 129569a466..2d7919e874 100644 --- a/src/widgets/kernel/qapplication.cpp +++ b/src/widgets/kernel/qapplication.cpp @@ -3299,7 +3299,7 @@ QT_WARNING_POP bool eventAccepted = tablet->isAccepted(); while (w) { QTabletEvent te(tablet->type(), relpos, tablet->globalPosF(), - tablet->device(), tablet->pointerType(), + tablet->deviceType(), tablet->pointerType(), tablet->pressure(), tablet->xTilt(), tablet->yTilt(), tablet->tangentialPressure(), tablet->rotation(), tablet->z(), tablet->modifiers(), tablet->uniqueId(), tablet->button(), tablet->buttons()); |