It’s pretty annoying having to create every time custom widgets where we redefine the event() or mousePressEvent() methods, just for the sake of responding to some events. In my case I only need to respond when the left mouse button is pressed, but I have about 10 QPushButtons that should do different things when pressed… in this case I would end up having 10 different custom widgets derived from QPushButton… looks to me like a waste of time.
So, is it possible to respond to events without having to derive Qt’s widgets to custom ones ?
↧