Open adam-grant-hendry opened 2 years ago
Reviewing:
and the available QWidget
virtual functions (Python)/protected functions (C++) in
it is evident that
QWidget
objects do not support mouseClick
(that mouseClick
can be called without breaking seems an accident)mouseClick
is only available for C++ (Qt5/Qt6) in QTest
PyQt5
, PySide2
, PyQt6
, andPySide6
All of the above (plus the referenced SO post by pyqtgraph) give me strong reason to suggest:
QTest.mouseClick()
(minimal change)QTest
mouse and key methods to QtGui
mouse and key events (as it is unlikely they will continue to work properly and/or be provided in python bindings of Qt in the future).
Referencing this SO issue, I am experiencing the same problem, even with
setMouseTracking
enabled (inwindows
mode, notheadless
). It appears as ifmousePress
andmouseClick
don't properly release mouse buttons.MRE
To get hovering to function, I am forced to use
mousePress
after moves when I shouldn't have to.Solution
pyqtgraph
has implemented a solution that works: write custom mouse movement methods instead of wrappingQTest
: