[PySide] Help importing compiled Qt resource file from subfolder

henry.wede at yahoo.com henry.wede at yahoo.com
Mon Sep 25 01:00:36 CEST 2023

I have spend the last few hours trying to figure this out and now I have to ask for some help.
My project has grown to the point where is needs to be more organized, so I am moving modules from one huge folder into subfolders.  I use a resource file in QtDesigner and then compile it resulting in a "something_rc.py".  With the "one huge folder" approach I just imported this file into any module that uses dialogs - this is the only way that the images would show up in the widgets.  Now I am struggling to do this with the folder structure.
I made a simple example that shows the issue.  The tree is below and the attached zip file contains everything.
pkg│   main.py│   test_local.py│├───images│       compiledresource_rc.py│└───utils        helpers.py        util.py        __init__.py

Briefly, main can import test_local and util without any problems.  The issue is that if helpers needs to import the compiled resource file compiledresource_rc.  I swear that I have tried the exact syntax from different Internet resources and I cannot get it to work.
Can somebody please help me deal with this resource file?
Thank you for your help,Henry

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20230924/4db89c3c/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: pkg.zip
Type: application/x-zip-compressed
Size: 1791 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/pyside/attachments/20230924/4db89c3c/attachment.bin>

More information about the PySide mailing list