When a resource file is created via Qt Designer in a Form, the python code generated by the Qt Designer includes the following import statement:
import icons_rc
This import statement is same irrespective of the qrc file location (say shared location \Modules\ZA\RES\ or ui location \Modules\ZA\MDH).
The generated form works only if the generated python file for qrc file is in same location as form; else it raises the error:
File "S:\...\Modules\ZA\MDH\ui_BObj.py", line 25, in <module>
import icons_rc
ModuleNotFoundError: No module named 'icons_rc'
This implies saving all images and compiled qrc file in same location as the UI/Form folder. I used PySide6 with pyside6-rcc and I believe this behaviour is same in PyQt as well.
Does this mean that qrc file for every UI form must be created in the respective locations, even if these forms use same common icon set?
All documentation/ posts on this topic talks about the qrc file format and compiler, but there is no indication on location of the resource files. Is it not possible to create a shared/ common icons qrc file in one location, compile it and then use it in different UI forms in different locations?