diff options
author | Frederik Gladhorn <frederik.gladhorn@theqtcompany.com> | 2016-07-29 13:34:29 +0200 |
---|---|---|
committer | Shawn Rutledge <shawn.rutledge@qt.io> | 2016-08-01 09:58:23 +0000 |
commit | 6f75096afc000991111bb0fd7a7e530ce3518627 (patch) | |
tree | c19b2774cf6ae18cbd477629466ff26d55bddb61 /src/gui/kernel/qevent.cpp | |
parent | f2995ee078661e2d8715cbbcab7871198082d725 (diff) |
Add helper function to reset QMouseEvent localPos
In Qt Quick there are many places which copy mouse events repeatedly,
with the only goal of adjusting the local position. Instead it's much
more sensible to re-use the same event.
Change-Id: I2c6f2b73ee3a7a6df489f813cf2f60b48a6e48df
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/gui/kernel/qevent.cpp')
-rw-r--r-- | src/gui/kernel/qevent.cpp | 12 |
1 files changed, 12 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 |