summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2014-09-05 16:24:23 +0400
committerShawn Rutledge <shawn.rutledge@digia.com>2014-09-08 15:35:40 +0200
commitf3cee50216b066dc204ab4482d329f4ff988b1e2 (patch)
treee8d53db0ef34b42a7ce005e1bb37f370808856d9 /src/widgets/kernel/qapplication.cpp
parent289e9af668df8b9f869ee42e295b582f246d6e32 (diff)
Fix a conversion of coordinates of a TouchBegin event
To convert coordinates to a parent's coordinate system one should translate them by an offset of a child widget relative to it's parent widget. QRect::moveCenter() doesn't translate, it sets the coordinates of the touch point's center to this offset. Change-Id: I9d823784803bd1448c0d665944090674d3ff518b Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index f438f60e47..3486396f54 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3563,7 +3563,7 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
for (int i = 0; i < touchEvent->_touchPoints.size(); ++i) {
QTouchEvent::TouchPoint &pt = touchEvent->_touchPoints[i];
QRectF rect = pt.rect();
- rect.moveCenter(offset);
+ rect.translate(offset);
pt.d->rect = rect;
pt.d->startPos = pt.startPos() + offset;
pt.d->lastPos = pt.lastPos() + offset;