[PySide] When Slots and When Subclass?

Tim Roberts timr at probo.com
Fri Mar 18 22:47:20 CET 2016


I'm coming to Qt late, after a long history with wxPython (and an even
longer history with direct-to-the API coding).  There's one item that is
tripping me up.

In wxPython and wxWidgets, EVERYTHING you can respond to is an event. 
When you want to handle some GUI thing, you look for an event to bind
to.  Since Qt is, in general, more orderly than wx, I had assumed that
Qt would be much the same, substituting signals and slots.  I've already
found that's not the case; in order to intercept keystrokes, I have to
subclass the control and provide a a keyPressEvent method.

Is there some document that can help me understand what's likely to be
signalled and what requires subclassing?  Some general rule you use in
practice?

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.




More information about the PySide mailing list