summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qplatformcursor.cpp
diff options
context:
space:
mode:
authorJoerg Bornemann <joerg.bornemann@digia.com>2014-09-16 15:42:30 +0200
committerJoerg Bornemann <joerg.bornemann@digia.com>2014-09-23 18:53:42 +0200
commit541b387c10673155193ec417fba0e49af52b8386 (patch)
tree1522b2de4e7a4000a7d07f13def9ab559b1f5bad /src/gui/kernel/qplatformcursor.cpp
parent06c31bdbec6416b0e7b6fd5999d41e239f5858ea (diff)
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 <robin.burchell@viroteck.net> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
Diffstat (limited to 'src/gui/kernel/qplatformcursor.cpp')
-rw-r--r--src/gui/kernel/qplatformcursor.cpp9
1 files 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