EventFilter Delete labeltext pyqt5

Florian Bruhin me at the-compiler.org
Wed May 5 18:52:56 BST 2021


Hey Luca,

On Wed, May 05, 2021 at 07:32:36PM +0200, Luca Bertolotti wrote:
> 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
> [...]
> def eventFilter(self, object, event):
>     [...]
>     return 1

By returning 1 (True) here, you filter all events:

https://doc.qt.io/qt-5/qobject.html#installEventFilter
"The eventFilter() function must return true if the event should be
filtered, (i.e. stopped); otherwise it must return false."

Florian

-- 
            me at the-compiler.org | https://www.qutebrowser.org 
       https://bruhin.software/ | https://github.com/sponsors/The-Compiler/
       GPG: 916E B0C8 FD55 A072 | https://the-compiler.org/pubkey.asc
             I love long mails! | https://email.is-not-s.ms/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: not available
URL: <https://www.riverbankcomputing.com/pipermail/pyqt/attachments/20210505/52ba3a17/attachment.sig>


More information about the PyQt mailing list