diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 12 | ||||
-rw-r--r-- | src/gui/kernel/qevent.h | 2 |
2 files changed, 14 insertions, 0 deletions
diff --git a/src/gui/kernel/qevent.cpp b/src/gui/kernel/qevent.cpp index 47c1f91fb0..d574ba5cc6 100644 --- a/src/gui/kernel/qevent.cpp +++ b/src/gui/kernel/qevent.cpp @@ -405,6 +405,18 @@ Qt::MouseEventFlags QMouseEvent::flags() const */ /*! + \fn void QMouseEvent::setLocalPos(const QPointF &localPosition) + + \since 5.8 + + \internal + + Sets the local position in the mouse event to \a localPosition. This allows to re-use one event + when sending it to a series of receivers that expect the local pos in their + respective local coordinates. +*/ + +/*! \fn QPointF QMouseEvent::windowPos() const \since 5.0 diff --git a/src/gui/kernel/qevent.h b/src/gui/kernel/qevent.h index fb8a49b1c6..fb72c561ab 100644 --- a/src/gui/kernel/qevent.h +++ b/src/gui/kernel/qevent.h @@ -132,6 +132,8 @@ public: inline Qt::MouseButton button() const { return b; } inline Qt::MouseButtons buttons() const { return mouseState; } + inline void setLocalPos(const QPointF &localPosition) { l = localPosition; } + #if QT_DEPRECATED_SINCE(5, 0) QT_DEPRECATED inline QPointF posF() const { return l; } #endif |