diff options
author | Alexander Volkov <a.volkov@rusbitech.ru> | 2015-04-22 18:43:33 +0300 |
---|---|---|
committer | Alexander Volkov <a.volkov@rusbitech.ru> | 2015-05-12 10:17:40 +0000 |
commit | 77e00909951f9274bccec20be950425ba9dbe744 (patch) | |
tree | d348e429407430b4e00e97d7d05e80c43decaf9d /src/gui/kernel/qguiapplication.cpp | |
parent | ac1b6c01454b8969e59becf066bba14f9ed0d310 (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/gui/kernel/qguiapplication.cpp')
-rw-r--r-- | src/gui/kernel/qguiapplication.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/gui/kernel/qguiapplication.cpp b/src/gui/kernel/qguiapplication.cpp index 926ec16f19..af93a93cfe 100644 --- a/src/gui/kernel/qguiapplication.cpp +++ b/src/gui/kernel/qguiapplication.cpp @@ -1766,9 +1766,8 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (!window) return; - QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers); + QMouseEvent ev(type, localPoint, localPoint, globalPoint, button, buttons, e->modifiers, e->source); ev.setTimestamp(e->timestamp); - setMouseEventSource(&ev, e->source); #ifndef QT_NO_CURSOR if (!e->synthetic()) { if (const QScreen *screen = window->screen()) @@ -1827,9 +1826,8 @@ void QGuiApplicationPrivate::processMouseEvent(QWindowSystemInterfacePrivate::Mo if (!e->window.isNull() || e->nullWindow()) { // QTBUG-36364, check if window closed in response to press const QEvent::Type doubleClickType = frameStrut ? QEvent::NonClientAreaMouseButtonDblClick : QEvent::MouseButtonDblClick; QMouseEvent dblClickEvent(doubleClickType, localPoint, localPoint, globalPoint, - button, buttons, e->modifiers); + button, buttons, e->modifiers, e->source); dblClickEvent.setTimestamp(e->timestamp); - setMouseEventSource(&dblClickEvent, e->source); QGuiApplication::sendSpontaneousEvent(window, &dblClickEvent); } } |