[PyQt] Newbe: ui files and resources

Oleg Klimov omgtech at gmail.com
Tue Dec 11 08:59:02 GMT 2007


> I also created a .qrc file for the "open" icon.
> I then run pyuic4 and pyrcc4 and they create the ui_ and qrc_
> files. The last line of the qrc_ files contains the
> line:
>
> import nrpapp_rc
>
> My app is called nrpapp. When i run my app, it complains because
> there is no nrpapp_rc. There is of course the qrc_nrpapp.py.
> If i get rid of the nrpapp_rc line in the ui_ file then it works
> fine (of course i include a line: import qrc_nrpapp in my nrpapp.py).

This should work just fine by default.

a.ui -> a_ui.py
a.qrc -> a_rc.py

a_ui.py expects a_rc.py (import a_rc), if you included .qrc in the designer.

I'd suggest you check the tools you're using to run pyuic4/pyrcc4.
These tools probably run 'pyuic4 a.ui -o wrong_output.py'. Try running
by hand from command line.


 Oleg


More information about the PyQt mailing list