Certain widgets will allow me to do:
self.widget.clicked.connect(on_click)
but doing:
self.widget.keyPressEvent.connect(on_key)
will fail saying that the object has no attribute 'connect'.
I know that sub-classing the widget and re-implementing the keyPressEvent
method will allow me to respond to the event. But how can I .connect()
to the keyboard event thereafter, or otherwise said, from a user context?