diff options
author | Laszlo Agocs <laszlo.p.agocs@nokia.com> | 2012-03-27 13:44:19 +0300 |
---|---|---|
committer | Qt by Nokia <qt-info@nokia.com> | 2012-03-27 17:36:26 +0200 |
commit | 59a5c78e20db507b4b21893ab9e4e833543e436e (patch) | |
tree | e464ccf0e3560b9989adea9ea526a88a933ea35a /src/gui/kernel/qcursor.cpp | |
parent | 854256cc699dc2dbdec0ecdf33a0b5578ab13012 (diff) |
Add QPA notes to QCursor pos() and setPos()
Change-Id: I7173816e0d792d6d26497b4fd59a57a50e512afd
Reviewed-by: Samuel Rødal <samuel.rodal@nokia.com>
Diffstat (limited to 'src/gui/kernel/qcursor.cpp')
-rw-r--r-- | src/gui/kernel/qcursor.cpp | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/gui/kernel/qcursor.cpp b/src/gui/kernel/qcursor.cpp index 95b2b4a28e..476d3a449b 100644 --- a/src/gui/kernel/qcursor.cpp +++ b/src/gui/kernel/qcursor.cpp @@ -205,6 +205,13 @@ QT_BEGIN_NAMESPACE You can call QWidget::mapFromGlobal() to translate it to widget coordinates. + \note The position is queried from the windowing system. If mouse events are generated + via other means (e.g., via QWindowSystemInterface in a unit test), those fake mouse + moves will not be reflected in the returned value. + + \note On platforms where there is no windowing system or cursors are not available, the returned + position is based on the mouse move events generated via QWindowSystemInterface. + \sa setPos(), QWidget::mapFromGlobal(), QWidget::mapToGlobal(), QGuiApplication::primaryScreen() */ @@ -218,6 +225,16 @@ QT_BEGIN_NAMESPACE You can call QWidget::mapToGlobal() to translate widget coordinates to global screen coordinates. + \note Calling this function results in changing the cursor position through the windowing + system. The windowing system will typically respond by sending mouse events to the application's + window. This means that the usage of this function should be avoided in unit tests and + everywhere where fake mouse events are being injected via QWindowSystemInterface because the + windowing system's mouse state (with regards to buttons for example) may not match the state in + the application-generated events. + + \note On platforms where there is no windowing system or cursors are not available, this + function may do nothing. + \sa pos(), QWidget::mapFromGlobal(), QWidget::mapToGlobal() */ |