anklickbares Ereignis auf QLabel in Python mit pyqt4?
Ich arbeite in Python-GUI mit pyqt4-Bibliothek und neu mit Signal und Slots. Ich weiß nicht, wie ich ein Ereignis auf einen Markennamen setzen sollQPLabel
. Hier ist mein Code:
class Ui_Form(object):
def setupUi(self, Form):
Form.setObjectName(_fromUtf8("Form"))
Form.resize(759, 598)
font = QtGui.QFont()
font.setPointSize(12)
...
...
...
self.QPLabel = QtGui.QLabel(Form)
self.QPLabel.setGeometry(QtCore.QRect(620, 420, 141, 20))
QtCore.QObject.connect(self.QPLabel, QtCore.SIGNAL(_fromUtf8("clicked()")), self.doSomething)
def doSomething(self):
print 'Label click'
Jedermann, was ich für ein Event auf dem Label tun soll, um eine Aktion auszuführen.