From 541b387c10673155193ec417fba0e49af52b8386 Mon Sep 17 00:00:00 2001 From: Joerg Bornemann Date: Tue, 16 Sep 2014 15:42:30 +0200 Subject: emulate mouse move in default implementation of QPlatformCursor::setPos When QCursor::setPos() is called and the platform plugin doesn't implement QPlatformCursor::setPos, a warning is printed. Additionally, we now emulate a mouse move to have a default implementation that's actually useful. QPlatformCursor::pos() now returns the position that was set by QPlatformCursor::setPos(), or other facilities that generate mouse events, for example the Tslib plugin. Change-Id: Ifc539202765f311baad085f72347aeb732f7b2ba Reviewed-by: Robin Burchell Reviewed-by: Friedemann Kleint --- src/gui/kernel/qplatformcursor.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/gui/kernel/qplatformcursor.cpp b/src/gui/kernel/qplatformcursor.cpp index c2f510b496..0162360718 100644 --- a/src/gui/kernel/qplatformcursor.cpp +++ b/src/gui/kernel/qplatformcursor.cpp @@ -122,8 +122,13 @@ QPoint QPlatformCursor::pos() const void QPlatformCursor::setPos(const QPoint &pos) { - Q_UNUSED(pos); - qWarning("This plugin does not support QCursor::setPos()"); + static bool firstCall = true; + if (firstCall) { + firstCall = false; + qWarning("This plugin does not support QCursor::setPos()" + "; emulating movement within the application."); + } + QWindowSystemInterface::handleMouseEvent(0, pos, pos, Qt::NoButton); } // End of display and pointer event handling code -- cgit v1.2.3