summaryrefslogtreecommitdiffstats
path: root/src/widgets
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@digia.com>2014-02-26 16:25:46 +0100
committerThe Qt Project <gerrit-noreply@qt-project.org>2014-02-27 13:28:41 +0100
commit81698e5484bf5b6d0b6d948fb935a7b3218812b8 (patch)
tree8e1afafa0454ee546991f90b9909e2100a3069de /src/widgets
parentb3aed29c434994f2e980a8ca371ab83b48e5d98b (diff)
Widgets: Pass on mouse event source when translating mouse events.
Change-Id: I70dacc2f96552e08dd71d5cbd63fb4cf9916c11f Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Diffstat (limited to 'src/widgets')
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 0e40dd866f..3cc48b442d 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -407,6 +407,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
widgetPos = receiver->mapFromGlobal(event->globalPos());
QWidget *alien = m_widget->childAt(m_widget->mapFromGlobal(event->globalPos()));
QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers());
+ QGuiApplicationPrivate::setMouseEventSource(&e, QGuiApplicationPrivate::mouseEventSource(event));
e.setTimestamp(event->timestamp());
QApplicationPrivate::sendMouseEvent(receiver, &e, alien, m_widget, &qt_button_down, qt_last_mouse_receiver);
} else {
@@ -442,6 +443,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
if (win && win->geometry().contains(event->globalPos())) {
const QPoint localPos = win->mapFromGlobal(event->globalPos());
QMouseEvent e(QEvent::MouseButtonPress, localPos, localPos, event->globalPos(), event->button(), event->buttons(), event->modifiers());
+ QGuiApplicationPrivate::setMouseEventSource(&e, QGuiApplicationPrivate::mouseEventSource(event));
e.setTimestamp(event->timestamp());
QApplication::sendSpontaneousEvent(win, &e);
}
@@ -498,6 +500,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event)
// creation of a MouseButtonDblClick event. QTBUG-25831
QMouseEvent translated(event->type(), mapped, event->windowPos(), event->screenPos(),
event->button(), event->buttons(), event->modifiers());
+ QGuiApplicationPrivate::setMouseEventSource(&translated, QGuiApplicationPrivate::mouseEventSource(event));
translated.setTimestamp(event->timestamp());
QApplicationPrivate::sendMouseEvent(receiver, &translated, widget, m_widget,
&qt_button_down, qt_last_mouse_receiver);