Solve PyQt6.0 Issue with Importing Icons from Qt-Designer
Why Stack Overflow recommends it
Stack Overflow users link it as a practical workaround for PyQt6 having no pyrcc, since it shows converting the .qrc resource file to Python using PySide6's resource compiler.
Recommended by 3 people across 3 different months, 2022 to 2022.
What it is
A short tutorial from the VisualComputer channel on fixing the missing icon and resource import problem when using Qt Designer with PyQt6. It also covers packaging the Python app into a single .exe file with PyInstaller.
What people said
Recommends adfinem_rising · 2022-10 · Stack Overflow · on “How can resources be provided in PyQt6 (which has no pyrcc)?”
for those people who want a real and simple solution just watch it here: link [this video] a guy figured it out by converting the "resource.qrc" into a .py file by using the pyrcc of PySide6. then importing the resource.py (same as before) in your PyQt6 project. everything is the same, including the special filepath syntax: ":/image.jpg" instead of "./image.jpg" hope it helps, always feels good to have a simpler solution.
Recommends panofish · 2022-11 · Stack Overflow · on “How can resources be provided in PyQt6 (which has no pyrcc)?”
Someone decided pyrcc6 wasn't useful and no longer provide it. However, what they don't understand is how useful it is for those of us that use qt designer to define our resources like icons.. etc and then using pyinstaller to package and find all resources, so that pyinstaller can build a stand-alone exe and these icons are properly embedded and used in the .ui user interface. You may find this link useful (I had no success with it though): [LINK] Ultimately, I switched from pyqt5 to pyside6 using pip which includes pyside6-rcc command to do the same thing that the old pyrcc5 command used to do. BTW pyqt6 has way too many enumeration and that makes transistion to pyqt6 painful, which is ano
Recommends Rishabh Bhardwaj · 2022-12 · Stack Overflow · on “How can resources be provided in PyQt6 (which has no pyrcc)?”
Adding further to youtube video (Update 28/12/22) [this video] Do it with the simple script: pyuic6 tip.ui > tip.py && sed -i '10iimport _cf_rc\nimport _rc_rc' tip.py Explaination here: sed -i "10i' -> means insert from the 10th line onwards. I have 2 files to insert in tip.py: import _cf_rc import _rc_rc