aboutsummaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
Diffstat (limited to 'examples')
-rw-r--r--examples/quick/customitems/maskedmousearea/maskedmousearea.cpp6
-rw-r--r--examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp4
2 files changed, 5 insertions, 5 deletions
diff --git a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
index 9a107e0143..55fce54ac0 100644
--- a/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
+++ b/examples/quick/customitems/maskedmousearea/maskedmousearea.cpp
@@ -115,7 +115,7 @@ bool MaskedMouseArea::contains(const QPointF &point) const
void MaskedMouseArea::mousePressEvent(QMouseEvent *event)
{
setPressed(true);
- m_pressPoint = event->pos();
+ m_pressPoint = event->position().toPoint();
emit pressed();
}
@@ -125,8 +125,8 @@ void MaskedMouseArea::mouseReleaseEvent(QMouseEvent *event)
emit released();
const int threshold = qApp->styleHints()->startDragDistance();
- const bool isClick = (threshold >= qAbs(event->x() - m_pressPoint.x()) &&
- threshold >= qAbs(event->y() - m_pressPoint.y()));
+ const bool isClick = (threshold >= qAbs(event->position().toPoint().x() - m_pressPoint.x()) &&
+ threshold >= qAbs(event->position().toPoint().y() - m_pressPoint.y()));
if (isClick)
emit clicked();
diff --git a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
index dc9d310ff2..9435c004a7 100644
--- a/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
+++ b/examples/quick/rendercontrol/rendercontrol_opengl/window_singlethreaded.cpp
@@ -324,12 +324,12 @@ void WindowSingleThreaded::mousePressEvent(QMouseEvent *e)
// 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
// because QQuickWindow thinks of itself as a top-level window always.
- 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 WindowSingleThreaded::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);
}