Icons in a Qt Application Not Appearing Up
Problem: Icons are not showing up in a Qt application, even though they are included in the .qrc file.
Solution: There are two things to consider: 1. Convert the .qrc File to a Python Module Add the "icons" part to the prefix and use pyside-rcc to convert the .qrc file into an icons_rc.py.
system('pyside-rcc icons.qrc -o icons_rc.py')
2. Include the Converted Python Module in the Project
In the code, add this line to import the converted Python module:
import icons_rc
Tip for Python 5 and Python 6 Users:
When compiling or running the code, use the MEI flag to tell the executables to find icons in the temporary folder, like this:
python setup.py build --embeddable -M"icons_rcc"
Alternate Solution:
1. Including the .qrc File in the Source Code
Another way to fix this issue is to include the .qrc file in the source code.
2. Running the Following Command to Generate the Python Code
$ qrc -verbose -py
3. Importing the Generated Python Code in the Project
import
With this, the icons should now show up in the Qt application. Good luck!