summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/gui/kernel/qwindowsysteminterface.cpp9
-rw-r--r--src/widgets/graphicsview/qgraphicsscene.cpp4
-rw-r--r--src/widgets/kernel/qapplication.cpp2
3 files changed, 6 insertions, 9 deletions
diff --git a/src/gui/kernel/qwindowsysteminterface.cpp b/src/gui/kernel/qwindowsysteminterface.cpp
index aefb377683..90541eb314 100644
--- a/src/gui/kernel/qwindowsysteminterface.cpp
+++ b/src/gui/kernel/qwindowsysteminterface.cpp
@@ -687,9 +687,8 @@ QList<QTouchEvent::TouchPoint>
states |= point->state;
p.setState(point->state);
- const QPointF screenPos = point->area.center();
- p.setScreenPos(QHighDpi::fromNativePixels(screenPos, window));
- p.setScreenRect(QHighDpi::fromNativePixels(point->area, window));
+ p.setScreenPos(QHighDpi::fromNativePixels(point->area.center(), window));
+ p.setEllipseDiameters(point->area.size());
// The local pos and rect are not set, they will be calculated
// when the event gets processed by QGuiApplication.
@@ -750,7 +749,9 @@ QList<QWindowSystemInterface::TouchPoint>
p.id = pt.id();
p.flags = pt.flags();
p.normalPosition = QHighDpi::toNativeLocalPosition(pt.normalizedPos(), window);
- p.area = QHighDpi::toNativePixels(pt.screenRect(), window);
+ QRectF area(QPointF(), pt.ellipseDiameters());
+ area.moveCenter(pt.screenPos());
+ p.area = QHighDpi::toNativePixels(area, window);
p.pressure = pt.pressure();
p.state = pt.state();
p.velocity = QHighDpi::toNativePixels(pt.velocity(), window);
diff --git a/src/widgets/graphicsview/qgraphicsscene.cpp b/src/widgets/graphicsview/qgraphicsscene.cpp
index 38c68b8fa5..f2ff658d3b 100644
--- a/src/widgets/graphicsview/qgraphicsscene.cpp
+++ b/src/widgets/graphicsview/qgraphicsscene.cpp
@@ -5920,10 +5920,6 @@ void QGraphicsScenePrivate::updateTouchPointsForItem(QGraphicsItem *item, QTouch
item->d_ptr->genericMapFromSceneTransform(static_cast<const QWidget *>(touchEvent->target()));
for (auto &touchPoint : touchEvent->_touchPoints) {
- // Deprecated TouchPoint::setRect clobbers ellipseDiameters, restore
- const QSizeF ellipseDiameters = touchPoint.ellipseDiameters();
- touchPoint.setRect(mapFromScene.map(touchPoint.sceneRect()).boundingRect());
- touchPoint.setEllipseDiameters(ellipseDiameters);
touchPoint.setPos(mapFromScene.map(touchPoint.scenePos()));
touchPoint.setStartPos(mapFromScene.map(touchPoint.startScenePos()));
touchPoint.setLastPos(mapFromScene.map(touchPoint.lastScenePos()));
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 80e4aa525e..4ea70096e8 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -4168,7 +4168,7 @@ bool QApplicationPrivate::updateTouchPointsForWidget(QWidget *widget, QTouchEven
QTouchEvent::TouchPoint &touchPoint = touchEvent->_touchPoints[i];
// preserve the sub-pixel resolution
- const QPointF screenPos = touchPoint.screenRect().center();
+ const QPointF screenPos = touchPoint.screenPos();
const QPointF delta = screenPos - screenPos.toPoint();
touchPoint.d->pos = widget->mapFromGlobal(screenPos.toPoint()) + delta;