I have a widget containing multiple child objects, which the user can select by clicking them.
I want to clear the current selection when the user clicks outside the widget and I'm wondering how best to detect these clicks.
Some constraints:
- It's not really viable to eat the
mousePressEvents
of surrounding objects througheventFilter
. - If I can avoid using
grabMouse()
, I'd like to, because of this warning from the docs:Warning: Bugs in mouse-grabbing applications very often lock the terminal. Use this function with extreme caution, and consider using the -nograb command line option while debugging.
Does that leave me with any other options?
Note: This app will be deployed cross-platform (at the very least Windows and Ubuntu)