Details
-
Bug
-
Resolution: Invalid
-
P3: Somewhat important
-
None
-
5.15, 6.4
Description
By subclassing a QToolButton or a QPushButton (or maybe any subclasses of QAbstractButton - haven't tested yet) and overriding its contextMenuEvent so that a QMenu::shown() is called within, the button cannot handle release correctly.
The bugged behavior goes like: if left-click is held as it is and then a right-click is also registered, releasing left button or both buttons won't make button release, while it can be released if no shown() is called. Also, creating menu, setting attribute and adding actions to menu won't trigger such behavior, i.e., the reason is solely related to shown().
It can be avoided by left-clicking on button again, or connect destroyed() signal of menu to setDown(false) method of button. But it is better to know what causes such behavior. Is it really a bug or designed to avoid some other issues?
A minimum reproducer is uploaded. Run the app, click the button as described above and issue can be reproduced.