diff options
| author | Lars Knoll <[email protected]> | 2011-09-01 11:13:35 +0200 |
|---|---|---|
| committer | Lars Knoll <[email protected]> | 2011-09-01 13:27:37 +0200 |
| commit | c2aea75c220984953c53c3813717713437649999 (patch) | |
| tree | e710906642169baf9213c047329d511e673bb98a /src/widgets/kernel/qwidgetwindow_qpa.cpp | |
| parent | cf5e669a06ec1d8bd08a4db9c2849c5d7ea9fec4 (diff) | |
Refactor QMouseEvent to contain the position inside the window
Rename the default accessors for positions to localPos, windowPos
and screenPos, to be explicit about their use.
Introduce a QT_NO_INTEGER_EVENT_COORDINATES define so one can make sure
to always use the float based coordinates.
Fixup all Qt code to use the correct constructor that specifies all
three coordinates.
Change-Id: If4bb93b8d1e2eb2440260d99680c468706cfe68f
Reviewed-on: http://codereview.qt.nokia.com/4058
Reviewed-by: Qt Sanity Bot <[email protected]>
Reviewed-by: Gunnar Sletta <[email protected]>
Diffstat (limited to 'src/widgets/kernel/qwidgetwindow_qpa.cpp')
| -rw-r--r-- | src/widgets/kernel/qwidgetwindow_qpa.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/widgets/kernel/qwidgetwindow_qpa.cpp b/src/widgets/kernel/qwidgetwindow_qpa.cpp index a6bbfe42665..4cd6b459896 100644 --- a/src/widgets/kernel/qwidgetwindow_qpa.cpp +++ b/src/widgets/kernel/qwidgetwindow_qpa.cpp @@ -188,7 +188,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) if (receiver != popup) widgetPos = receiver->mapFromGlobal(event->globalPos()); QWidget *alien = m_widget->childAt(m_widget->mapFromGlobal(event->globalPos())); - QMouseEvent e(event->type(), widgetPos, event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QMouseEvent e(event->type(), widgetPos, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers()); QApplicationPrivate::sendMouseEvent(receiver, &e, alien, m_widget, &qt_button_down, qt_last_mouse_receiver); } else { // close disabled popups when a mouse button is pressed or released @@ -253,7 +253,7 @@ void QWidgetWindow::handleMouseEvent(QMouseEvent *event) return; } - QMouseEvent translated(event->type(), mapped, event->globalPos(), event->button(), event->buttons(), event->modifiers()); + QMouseEvent translated(event->type(), mapped, event->windowPos(), event->screenPos(), event->button(), event->buttons(), event->modifiers()); QApplicationPrivate::sendMouseEvent(receiver, &translated, widget, m_widget, &qt_button_down, qt_last_mouse_receiver); |
