Set screen position when generating synthetic mouse events from touch

QGraphicsView uses QMouseEvent::globalPos(), so we need to set
it when synthesizing mouse events in QApplication.

Change-Id: I8341e09fdd41400c5c5e1d0ee17c7323efdafaeb
Reviewed-by: Morten Johan Sørvig <morten.sorvig@digia.com>
This commit is contained in:
Morten Johan Sørvig 2013-03-25 18:09:54 +01:00 committed by The Qt Project
parent 470f92167f
commit c5323959d7

View File

@ -3788,7 +3788,7 @@ bool QApplicationPrivate::translateTouchToMouse(QWidget *widget, QTouchEvent *ev
const QPoint pos = widget->mapFromGlobal(p.screenPos().toPoint());
QMouseEvent mouseEvent(eventType, pos,
QMouseEvent mouseEvent(eventType, pos, p.screenPos().toPoint(),
Qt::LeftButton, Qt::LeftButton,
event->modifiers());
mouseEvent.setAccepted(true);