Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.10, 5.11, 5.12
-
None
Description
Introduction
Sometimes it's necessary to move the mouse further than allowed by the bounds of the screen:
Imagine a slider that uses the downscaled mouse movement to allow fine adjustments. When that slider is close to the edge of the screen, the movement of the cursor can be blocked.
A common solution is to "freeze" the cursor at the pressed position while the slider is moved. This is implemented by returning the cursor to the frozen position in the mouseMoveEvent handler using QCuror::setPos. (This causes unpleasant jumps of the cursor, so it gets hidden.)
Description
When the cursor is moved in the mouseMoveEvent handler using QCursor::setPos, QMouseEvent::localPos / QHoverEvent::posF and QCursor::pos may differ:
- build the attached project
- quickly press, move and release the mouse on either of the two rectangles
- the red rectangle logs mismatched positions in the mouseMoveEvent handler
- the green rectangle logs mismatched positions in the mouseHoverMove event handler
possible output:
mouseMoveEvent, positions differ: event : QPointF(134,216) cursor: QPointF(137,232) hoverMoveEvent, positions differ: event : QPointF(90,161) cursor: QPointF(89,166)
Attachments
Issue Links
- depends on
-
QTBUG-93180 API for cross-platform relative pointer events ?
- Reported
- relates to
-
QTBUG-92264 WasdController should provide a way to keep rotating the camera regardless of hitting screen edges
- Closed