GLViewWidget: don't assume mouse tracking is disabled#2653
Merged
j9ac9k merged 1 commit intopyqtgraph:masterfrom Mar 18, 2023
Merged
GLViewWidget: don't assume mouse tracking is disabled#2653j9ac9k merged 1 commit intopyqtgraph:masterfrom
j9ac9k merged 1 commit intopyqtgraph:masterfrom
Conversation
Member
|
Thanks @pijyoi always love to see the code cleaned up and unnecessary methods removed. |
|
I now had to set the following to not jump between mouse clicks and keep the behaviour the a same as before. (Using pyqt5) |
Contributor
Author
|
Hi @l-spiecker , thank you for the bug report and sorry for having caused the bug! |
|
Nice, works now again. Thanks! |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In
mouseMoveEvent, it is assumed thatself.mousePoshas already been set. This amounts to assuming that there is at least onemousePressEventprior tomouseMoveEvent.This amounts to assuming that mouse tracking is left at its default disabled state.
This PR removes this assumption and simplifies the code by removing the
mousePressEventhandler altogether.Relevant documentation: https://doc.qt.io/qt-6/qwidget.html#mouseMoveEvent
"If mouse tracking is switched off, mouse move events only occur if a mouse button is pressed while the mouse is being moved. If mouse tracking is switched on, mouse move events occur even if no mouse button is pressed."
This is partially related to the
GLViewWindowimplementation in #2650. In aQOpenGLWindow, there is no mouse tracking enable/disable.