[Qgis-developer] pyuic4 and ui files in subfolder

Denis Rouzaud denis.rouzaud at gmail.com
Wed Mar 5 07:01:35 PST 2014

Hi all,

I have been annoyed by a small problem for a while without finding a 
solution for it.

In my plugins, I place all the ui files in a subfolder named ui.
The resources file is at the root folder.

So, in the ui file I have
<iconset resource="../resources.qrc">

But when I compile, I got in the python file (also located in ui folder):
import resources_rc
which gives an error, because it can't find the resource files.

What would be the solution to this (something else than moving the file)?

My makefile is like this:
UI_SOURCES=$(wildcard ui/*.ui)
UI_FILES=$(join $(dir $(UI_SOURCES)), $(notdir $(UI_SOURCES:%.ui=%.py)))
RC_SOURCES=$(wildcard *.qrc)
RC_FILES=$(join $(dir $(RC_SOURCES)), $(notdir $(RC_SOURCES:%.qrc=%_rc.py)))

$(UI_FILES): ui/%.py: ui/%.ui
     pyuic4 -o $@ $<

$(RC_FILES): %_rc.py: %.qrc
     pyrcc4 -o $@ $<

Is it a problem of my rules or a pyuic problem?


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20140305/4ed4b1e5/attachment-0001.html>

More information about the Qgis-developer mailing list