clickable event on QLabel in python using pyqt4?

后端 未结 2 1999
名媛妹妹
名媛妹妹 2021-02-07 10:02

I am working in python GUI using pyqt4 library and new with signal and slots. I don\'t know how to put event on label name QPLabel. Here is my code :



        
2条回答
  •  既然无缘
    2021-02-07 10:30

    QLabel doesn't have a signal clicked, so you can do one of the following:

    A) Derive a custom class from QLabel implementing handlers for mouse events.

    B) Implement the event handlers in Ui_Form, using standard QLabels and install the form as an event filter for the labels (self.QPLabel.installEventFilter (self)).

提交回复
热议问题