From 6f75096afc000991111bb0fd7a7e530ce3518627 Mon Sep 17 00:00:00 2001 From: Frederik Gladhorn Date: Fri, 29 Jul 2016 13:34:29 +0200 Subject: 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 --- src/gui/kernel/qevent.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/gui/kernel/qevent.h') 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 -- cgit v1.2.3