question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Qt eventFilters only work when "all" Qt plugins are selected

See original GitHub issue

I’m trying to change the background of a program using eventFilter(). The background change should take place after hovering the mouse over the buttons. But after compiling with Nuitka, this function does not work. I wrote a small example and added a video so that if you want you can reproduce the error.

Exemple link: https://drive.google.com/file/d/1e9SUbP0nnDTJ6H2_wA_8-l9PGAC1WbhY/view?usp=sharing

Those were the arguments that I used on Windows: nuitka --mingw64 --onefile --plugin-enable=pylint-warnings --plugin-enable=qt-plugins --include-data-file=images\*=images\ --windows-onefile-tempdir main.py

https://doc.qt.io/archives/qtforpython-5.12/PySide2/QtCore/QObject.html#PySide2.QtCore.PySide2.QtCore.QObject.installEventFilter

https://srinikom.github.io/pyside-docs/PySide/QtCore/QObject.html#PySide.QtCore.PySide.QtCore.QObject.installEventFilter

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
hirioscommented, Apr 13, 2021

Again I thank the Nuitka project and its quick return, I think I can finish the issue now.

0reactions
hirioscommented, Apr 13, 2021

And I don’t quite get, why you needed to replace the slashes in the path. Not having a working URL that is relative to __file__ is a bug, as you require execution inside the dist folder, or inside the python file folder, which is unfriendly.

Apparently the setStyleSheet method only accepts this bar /

But I’m not sure, maybe I’m using it the wrong way

Read more comments on GitHub >

github_iconTop Results From Across the Web

My Qt eventFilter() doesn't stop events as it should
Everything else works as expected. Only the event filter fails. I want the filter to remove events sent to the window that created...
Read more >
The Event System - Qt for Python - Qt Documentation
The installEventFilter() function enables this by setting up an event filter, causing a nominated filter object to receive the events for a target...
Read more >
QLibrary: find AVX2 (Haswell) optimized plugins and libraries
QLibrary: find AVX2 (Haswell) optimized plugins and libraries Libraries are placed in a subdir "haswell/" of the main library dir, whereas plugins are ......
Read more >
QCoreApplication Class | Qt Core | Qt Documentation (Pro)
Note that this function is called for all events sent to any object in any thread. For certain types of events (e.g. mouse...
Read more >
Why aren't more desktop apps written with Qt? [closed]
Yes, there are issues with static linking (rolling all of Qt into the binary) ... on the desktop that a lot of software...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found