EventFilter Delete labeltext pyqt5

Luca Bertolotti luca72.bertolotti at gmail.com
Wed May 5 18:32:36 BST 2021


i have as follow and in the label i never read the text:
if i comment the  self.label_10.installEventFilter(self) i read the text
Any suggestion
class Form(QWidget, Ui_Form):
    """
    Class documentation goes here.
    """
    def __init__(self, parent=None):
        """
        Constructor

        @param parent reference to the parent widget (defaults to None)
        @type QWidget (optional)
        """
        super(Form, self).__init__(parent)
        self.setupUi(self)
        self.controllo_stato = True
        self.timer = QTimer()
        self.timer.timeout.connect(self.leggo)
        self.fun = ctypes.WinDLL('C:\Kvara\Exe\KvCom3x.dll')
        self.fun_one = ctypes.WinDLL('C:\Kvara\Exe\ErrorHand.dll')
        self.label_10.setText('testlabel')
        self.label_10.installEventFilter(self)

def eventFilter(self, object, event):
        if event.type() == QEvent.HoverLeave:
            print('a')
        if event.type() == QEvent.HoverEnter:
            print('b')
        if event.type() == QEvent.HoverMove:
            print('c')
        print('evento')
        return 1
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210505/b14f869a/attachment.htm>


More information about the PyQt mailing list