diff options
Diffstat (limited to 'examples')
-rw-r--r-- | examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp | 4 | ||||
-rw-r--r-- | examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp b/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp index 884f7e3981..918698effe 100644 --- a/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp +++ b/examples/quick/rendercontrol/rendercontrol_d3d11/window.cpp @@ -175,13 +175,13 @@ void Window::exposeEvent(QExposeEvent *) void Window::mousePressEvent(QMouseEvent *e) { - QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers()); + QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); } void Window::mouseReleaseEvent(QMouseEvent *e) { - QMouseEvent mappedEvent(e->type(), e->localPos(), e->screenPos(), e->button(), e->buttons(), e->modifiers()); + QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); } diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp index 8f3bfe77db..8316772d3c 100644 --- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp +++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp @@ -318,9 +318,9 @@ void WindowSingleThreaded::handleScreenChange() void WindowSingleThreaded::mousePressEvent(QMouseEvent *e) { - // Use the constructor taking localPos and screenPos. That puts localPos into the - // event's localPos and windowPos, and screenPos into the event's screenPos. This way - // the windowPos in e is ignored and is replaced by localPos. This is necessary + // Use the constructor taking position and globalPosition. That puts position into the + // event's position and scenePosition, and globalPosition into the event's globalPosition. This way + // the scenePosition in e is ignored and is replaced by position. This is necessary // because QQuickWindow thinks of itself as a top-level window always. QMouseEvent mappedEvent(e->type(), e->position(), e->globalPosition(), e->button(), e->buttons(), e->modifiers()); QCoreApplication::sendEvent(m_quickWindow, &mappedEvent); |