path: root/src/gui/kernel/qcursor.h
diff options
authorFriedemann Kleint <>2012-03-05 14:42:42 +0100
committerQt by Nokia <>2012-03-07 22:43:43 +0100
commitb319d44798fe4c5aa8b859966d64f28b08be28dd (patch)
treefc24d20ebff32b89f02e0390950fc33f38f7e972 /src/gui/kernel/qcursor.h
parentb7915a4d0d97a60fc30e55eb4cc1b10e7fe9ce2f (diff)
QCursor: Associate cursor with screen.
- Introduce cursor() accessor to QPlatformScreen. - Remove screen member of QPlatformCursor (a cursor can be shared by multiple screens of a virtual desktop). - Add QCursor::pos()/ QCursor::setPos() taking a QScreen-parameter, use primaryScreen() for old overloads. QCursor::pos() can then query the platform cursor for the position and return the position even if the mouse position is outside the windows owned by the Qt application. - Fix tests Reviewed-by: Samuel Rødal <> Task-number: QTBUG-22457 Task-number: QTBUG-22565 Task-number: QTBUG-20753 Change-Id: Ia69f37343f95772e934eab1cd806bd54cbdbbe51 Reviewed-by: Friedemann Kleint <>
Diffstat (limited to 'src/gui/kernel/qcursor.h')
1 files changed, 4 insertions, 0 deletions
diff --git a/src/gui/kernel/qcursor.h b/src/gui/kernel/qcursor.h
index 00b709b308..4820bcee9b 100644
--- a/src/gui/kernel/qcursor.h
+++ b/src/gui/kernel/qcursor.h
@@ -51,6 +51,7 @@ QT_BEGIN_NAMESPACE
class QVariant;
+class QScreen;
### The fake cursor has to go first with old qdoc.
@@ -101,8 +102,11 @@ public:
QPoint hotSpot() const;
static QPoint pos();
+ static QPoint pos(const QScreen *screen);
static void setPos(int x, int y);
+ static void setPos(QScreen *screen, int x, int y);
inline static void setPos(const QPoint &p) { setPos(p.x(), p.y()); }
+ inline static void setPos(QScreen *screen, const QPoint &p) { setPos(screen, p.x(), p.y()); }
#ifdef qdoc
HCURSOR_or_HANDLE handle() const;