key events handler return value to True to stop propagation#6397
key events handler return value to True to stop propagation#6397tacaswell merged 2 commits intomatplotlib:masterfrom
Conversation
|
Qt does not have this notion of a 'callback' chain. Each signal can propagate to 0 or more slots, but they are, my understanding, all independently executed. |
| if _debug: print("hit", key) | ||
| FigureCanvasBase.key_press_event(self, key, guiEvent=event) | ||
| return False # finish event propagation? | ||
| return True # stoping event propagation |
There was a problem hiding this comment.
"stopping", not "stoping", but actually, just use "stop".
|
@tacaswell Qt's signals/slots mechanism is separate from its event handling (like keyboard events). Qt's event handling does have the notion of stopping the propagating of events. |
|
@dopplershift 🐑 For reference http://doc.qt.io/qt-4.8/eventsandfilters.html |
|
On a bit further reading, the notion of event propagation is handled by the method |
|
So with the changes in this PR we are at the same level that Qt |
MNT: key events handler return value to True to stop propagation it gtk
|
backported to 2.x as 9b39f3e |
Fixing #6349
Right now only stopping the key press and key release event from propagating after callback.
I am in doubt about the other events, should be stopped also?
@tacaswell how does it work in Qt?