[PyQt] How can I use resource file created by designer

bluekyu bluekyu.dev at gmail.com
Fri Feb 17 04:54:15 GMT 2012


Hello. I use python3 and PyQt 4.8. I have a problem about module import.

I created resource file using designer and then converted .ui to python 
module using pyuic4.
I knew that ui module have "import rc_xxx", so I also converted .qrc to 
rc_xxx.py using pyrcc4 -py3.

But my program use my python package, so "import rc_xxx" is not worked.
(ui module and rc module are in my python package directory)

I can use "from . import rc_xxx" syntax in ui module, or add my library 
path to sys.path in my main source.
But I think these are not clear solutions.

Is there another solution for this problem? or
should I create resource file not using designer? (to use "from 
my_package import rc_xxx" syntax in main source)


More information about the PyQt mailing list