diff options
| author | MohammadHossein Qanbari <mohammad.qanbari@qt.io> | 2024-03-07 14:48:10 +0100 |
|---|---|---|
| committer | MohammadHossein Qanbari <mohammad.qanbari@qt.io> | 2024-03-26 10:38:52 +0100 |
| commit | 73eeb35f09fd1ea846bb0f5ce507316f587fda9f (patch) | |
| tree | 706fbd90a740da7d44334683aee442c4b56c86ea /examples/qml/referenceexamples/adding/example.qml | |
| parent | 4299d0bb92745fc377b8df0fb246f3081465a195 (diff) | |
Flickable: don't allow dragging with mouse buttons other than left
The SwipeView's page did not change to a new page when the user
right-clicked on text content inside the page. This occurred because
the mouse press event enabled the 'pressed' variable, indicating the
beginning of a drag. Since the text item did not accept the press event,
there was no need to handle the move and release events. Consequently,
the 'pressed' variable remained true.
If the 'pressed' variable is true, then the SwipeView's contentItem does
not update the highlight item. This implies that the highlight animators
will not start. Consequently, although the current index and item would
change, the content item view is not updated.
To fix this issue, the 'pressed' variable should not be true when the
press event is not accepted. When it's a mouse event, the value of the
'pressed' variable is set to true when the left button is pressed,
similar to the existing condition in the handleMoveEvent() method.
Since the bug originated in 'maybeBeginDrag()', the condition is added
to this method by passing the event's buttons.
The testcase creates a SwipeView component with two page items that
include a Label item. The test involves performing mouse and touch
events on the text content. Subsequently, when the current index is
changed, the testcase compares the content item to ensure it is
adjusted to its position to display the current item accordingly.
[ChangeLog][Quick][Flickable][Drag] Flickable is meant to be dragged
(flicked) by touch events; and as a matter of legacy support, for now
it can also be dragged by the left mouse button. Dragging with other
mouse buttons, such as the right and middle buttons, is not allowed.
Task-number: QTBUG-97252
Pick-to: 5.15
Change-Id: Ice23650dd29fe400b80efe299c9294fad62dcefb
Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'examples/qml/referenceexamples/adding/example.qml')
0 files changed, 0 insertions, 0 deletions
