Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revamp mapcanvas gesture handlers & fix propagation issues #2822

Merged

Conversation

tomasMizera
Copy link
Collaborator

@tomasMizera tomasMizera commented Oct 2, 2023

This PR is a complete rewrite of MapCanvas gesture handlers.
Due to multiple issues in Qt (like QTBUG-108689, QTBUG-108821 and more..), TapHandlers, DragHandlers and PinchHandlers were a pain to use and maintain.

  • they were fighting who should get an exclusive grab (often resulting in no one and frozen UI)
  • taps were propagated to parent scopes even though they should not

The new implementation is minimal and contains only PinchArea with nested MouseArea. Drags and double-clicks are implemented on our own now.

Important: we no longer support tap&drag gesture to zoom in/out the map.
If needed, it will not be hard to add it to the current implementation though

There are still some bits and pieces needed to get rid of the propagation issues (will be a part of this PR):

  • replace TapHandlers with MouseAreas everywhere (@iiLubos)
  • get rid of the remaining code used as a workaround for the mentioned issues

We need quite a massive testing to make sure the map gestures work properly 😏

Fixes #2549
Fixes #2683
Fixes #2684
Fixes #2617

@PeterPetrik PeterPetrik added the ready-for-testing Ready to be tested by testers crew - passed review by devs label Oct 4, 2023
@tomasMizera tomasMizera removed the ready-for-testing Ready to be tested by testers crew - passed review by devs label Oct 4, 2023
@tomasMizera
Copy link
Collaborator Author

Not ready for testing yet

@tomasMizera tomasMizera marked this pull request as ready for review October 5, 2023 07:18
@tomasMizera tomasMizera changed the title WIP: Revamp mapcanvas gesture handlers & fix propagation issues Revamp mapcanvas gesture handlers & fix propagation issues Oct 5, 2023
Copy link
Contributor

@PeterPetrik PeterPetrik left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@tomasMizera tomasMizera merged commit 6775145 into master Oct 5, 2023
10 of 11 checks passed
@tomasMizera tomasMizera deleted the Button-propagates-clicks-from-toolbar_CU-861mp5x42 branch October 5, 2023 13:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment