summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel/qapplication.cpp
diff options
context:
space:
mode:
authorAlexander Volkov <a.volkov@rusbitech.ru>2015-04-22 18:43:33 +0300
committerAlexander Volkov <a.volkov@rusbitech.ru>2015-05-12 10:17:40 +0000
commit77e00909951f9274bccec20be950425ba9dbe744 (patch)
treed348e429407430b4e00e97d7d05e80c43decaf9d /src/widgets/kernel/qapplication.cpp
parentac1b6c01454b8969e59becf066bba14f9ed0d310 (diff)
QMouseEvent: add constructor which takes the source as a parameter
Simplify the code by passing the source of a mouse event directly to the constructor instead of setting it by QGuiApplicationPrivate::setMouseEventSource(). Change-Id: I1774cf39a211d36d3adf0ff30f3bd2fb7c5fb429 Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
Diffstat (limited to 'src/widgets/kernel/qapplication.cpp')
-rw-r--r--src/widgets/kernel/qapplication.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index dd7474b930..401fb47dc8 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3250,12 +3250,11 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
QPointer<QWidget> pw = w;
while (w) {
- QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(), mouse->button(), mouse->buttons(),
- mouse->modifiers());
+ QMouseEvent me(mouse->type(), relpos, mouse->windowPos(), mouse->globalPos(),
+ mouse->button(), mouse->buttons(), mouse->modifiers(), mouse->source());
me.spont = mouse->spontaneous();
me.setTimestamp(mouse->timestamp());
QGuiApplicationPrivate::setMouseEventFlags(&me, mouse->flags());
- QGuiApplicationPrivate::setMouseEventSource(&me, mouse->source());
// throw away any mouse-tracking-only mouse events
if (!w->hasMouseTracking()
&& mouse->type() == QEvent::MouseMove && mouse->buttons() == 0) {