Eric Frederich
Wed, 25 Aug 2010 13:43:50 -0700
If I find myself subclassing a widget just to get something to happen on an event am I doing something wrong? Is there another way to accomplish this? Is there a way to use an event like a signal in a self.connect?
For example... If I want so do something when a label is clicked I have done
the following and then just connect to the signal I emmit.
class ClickableLabel(QLabel):
def __init__(self, *args, **kwargs):
super(ClickableLabel, self).__init__(*args, **kwargs)
def mousePressEvent(self, event):
self.emit(SIGNAL("clicked"))
Thanks,
~Eric
_______________________________________________ PyQt mailing list PyQt@riverbankcomputing.com http://www.riverbankcomputing.com/mailman/listinfo/pyqt