diff options
Diffstat (limited to 'src/gui')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 17 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 5 |
2 files changed, 14 insertions, 8 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 7db77f5ee5..a4e44f5b8d 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -410,16 +410,21 @@ void QEventPoint::setAccepted(bool accepted) /*! \obsolete - Deprecated since Qt 6.0. Use globalPosition() instead. + \fn QPointF QPointerEvent::normalizedPos() const + Deprecated since Qt 6.0. Use normalizedPosition() instead. +*/ + +/*! Returns the normalized position of this point. - The coordinates are normalized to QInputDevice::availableVirtualGeometry(), - i.e. (0, 0) is the top-left corner and (1, 1) is the bottom-right corner. + The coordinates are calculated by transforming globalPosition() into the + space of QInputDevice::availableVirtualGeometry(), i.e. \c (0, 0) is the + top-left corner and \c (1, 1) is the bottom-right corner. - \sa startNormalizedPos(), lastNormalizedPos(), pos() + \sa globalPosition() */ -QPointF QEventPoint::normalizedPos() const +QPointF QEventPoint::normalizedPosition() const { auto geom = d->device->availableVirtualGeometry(); if (geom.isNull()) @@ -449,7 +454,7 @@ QPointF QEventPoint::startNormalizedPos() const move event. The coordinates are normalized to QInputDevice::availableVirtualGeometry(), - i.e. (0, 0) is the top-left corner and (1, 1) is the bottom-right corner. + i.e. \c (0, 0) is the top-left corner and \c (1, 1) is the bottom-right corner. \sa normalizedPos(), startNormalizedPos() */ diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index f4cbf6f7af..2459f1ba9d 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -145,6 +145,7 @@ public: QPointF globalPressPosition() const; QPointF globalGrabPosition() const; QPointF globalLastPosition() const; + QPointF normalizedPosition() const; #if QT_DEPRECATED_SINCE(6, 0) // QEventPoint replaces QTouchEvent::TouchPoint, so we need all its old accessors, for now @@ -162,8 +163,8 @@ public: QPointF startScreenPos() const { return globalPressPosition(); } QT_DEPRECATED_VERSION_X_6_0("Use globalPressPosition()") QPointF startNormalizedPos() const; - QT_DEPRECATED_VERSION_X_6_0("Use globalPosition()") - QPointF normalizedPos() const; + QT_DEPRECATED_VERSION_X_6_0("Use normalizedPosition()") + QPointF normalizedPos() const { return normalizedPosition(); } QT_DEPRECATED_VERSION_X_6_0("Use lastPosition()") QPointF lastPos() const { return lastPosition(); } QT_DEPRECATED_VERSION_X_6_0("Use sceneLastPosition()") |