I am having issues creating a PyQt4 resources file to display images in my QGIS 2 custom feature form using Windows XP. EDIT This still gives me problems with windows 7 on 32 and 64 bit machines, so I'm pretty sure this isn't system related. Any suggestions to check if pyqt or pyrcc is installed correctly..?
These are the steps I followed:
-Added QLabel and clicked "choose resource…"
-Created my .qrc in PyQt4 designer, linked .png image file. Checked my file with notepad, and following lead of some tutorials made a few modifications (because it didn't work with the untouched resource file direct from PyQt4) My .qrc looks like this:
<!DOCTYPE RCC><RCC version ="1.0"> <qresource prefix="/"> <file>img/image.png</file> </qresource> </RCC>
-Saved the ui and compiled the resource file in the windows command line using:
pyrcc4 -o image_rc.py image.qrc
-I even tried compiling the ui to py and moved the import space_rc to the top. I'm pretty sure this has nothing to do with the qrc file though, as it is for compiling the ui file.
pyuic4 -o form.py form.ui
the image is called like so:
my file system structure is like so:
ui/resource.qrc ui/form.ui ui/img/image.png
Under my layer's properties in QGIS, I chose to add custom ui and linked to the ui created in PyQt designer. When opening the feature form, I see only my frame, but no image. After reading many tutorials on what steps to follow, I can't see what I am missing.
I had believed it was a environment variable PATH issue (conflicting with GDAL), but now I switched computers and my issue is back. The windows environmental path for PyQt is the very first one, and I still don't see my image.