[PySide] examples/explainers for event filters?

Cristián Maureira-Fredes Cristian.Maureira-Fredes at qt.io
Wed Aug 31 09:36:18 CEST 2022



On 8/31/22 00:58, Gordon L. Kindlmann wrote:
> Hello,

Hey!

> I'm looking for simple examples or explainers on how to do event filtering in PySide6.  A google search result for:
> pyside6 event filter examples
> has as first result:
> https://doc.qt.io/qtforpython/overviews/eventsandfilters.html#event-filters

You can check this example
that implements eventFilter
https://code.qt.io/cgit/pyside/pyside-setup.git/tree/examples/network/googlesuggest 
(see googlesuggest.py)

> 
> But I have the feeling that this content represents some incomplete translation of C++ code and its description (the code has opening braces "{" and the text refers to true/false instead of True/False), so I'm not sure how much to trust this material.

Yeah, indeed that's one of the wrongly translated snippets,
because the process is automated. Could you please open a bug report to 
fix it?

> I may be in the minority of PySide users in not having used Qt before, with only glancing interactions with C++, as I look to PySide as a better way to make guis for Python code.  These documentation glitches make me think I'm missing some other resources that are more specifically about PySide6.  Any advice?

You are not missing out other material,
personally, I always recommend people to check the 'examples'
for learning purposes.

The reason of having those mistranslated snippets
is because before, that was a manual process,
and due to the amount of snippets in Qt,
it was never even 20% done. So the team decided
to automatically translate the snippets,
which can provide more context, but with a price
of having some of them wrongly translated.
For that, we require feedback (like the one you gave!)
of which are the snippets that require a fix.

> Thank you,
> Gordon

Regarding that page,
you can find the C++ code as well:
https://doc.qt.io/qt-6/eventsandfilters.html

Once you file the bug report, we can do a manual
translation and provide the proper code snippets in
https://doc.qt.io/qtforpython/overviews/eventsandfilters.html#event-filters


Cheers!

-- 
Dr. Cristian Maureira-Fredes
Senior R&D Manager

The Qt Company GmbH
Erich-Thilo-Str. 10
D-12489 Berlin

Geschäftsführer: Mika Pälsi,
Juha Varelius, Mika Harjuaho
Sitz der Gesellschaft: Berlin,
Registergericht: Amtsgericht
Charlottenburg, HRB 144331 B
--


More information about the PySide mailing list