Issue
I'm having a hard time making the icons from my application visible when the it runs. I've tried everything I could search, and still I don't know what could be wrong. My current dir looks like:
myapp/
├─ main.py
├─ icons_rc.py
├─ ui_window.py
├─ window.ui
├─ icons.qrc
├─ icons/
│ ├─ icon1.png
| ├─ ...
| ├─ iconN.png
The icons_rc.py
file was generated with the command pyrcc5 icons.qrc -o icons_rc.py
and it's imported to both the main.py
and ui_window.py
.
The icons.qrc
file was generated in QtDesigner as the following:
<RCC>
<qresource prefix="/">
<file>icons/icon1.png</file>
...
<file>icons/iconN.png</file>
</qresource>
</RCC>
I've tried generating the .qrc
file again, putting it inside the icons
folder, changing the prefix of the file, and looked extensively into tutorials on how to do it step-by-step and still I have no clue what I'm doing wrong.
Solution
After some months ignoring this particular problem from my project, I finally was able to solve it! What I did was to add the "icons" part to the prefix, and used pyside-rcc to convert the .qrc file into a icons_rc.py, following a tutorial from PyQt's documentation page
Answered By - olenscki
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.