python - PyQt resource file for QGIS feature form icon -


i having issues creating pyqt4 resources file display images in qgis 2 custom feature form using windows xp. these steps followed:

-added qlabel , clicked "choose resource…"

-created .qrc in pyqt4 designer, linked .png image file. checked file notepad, , following lead of tutorials made few modifications (because didn't work untouched resource file direct pyqt4) .qrc looks this:

<!doctype rcc><rcc version ="1.0">     <qresource prefix="/">         <file>img/image.png</file>     </qresource> </rcc> 

-saved ui , compiled resource file in windows command line using:

pyrcc4 -o image_rc.py image.qrc 

-i tried compiling ui py , moved import space_rc top

pyuic4 -o form.py form.ui 

then:

import image_rc 

the image called so:

self.label_7.setpixmap(qtgui.qpixmap(_fromutf8(":/img/image.png"))) 

my file system structure so:

ui/resource.qrc ui/form.ui ui/img/image.png 

under layer's properties in qgis, chose add custom ui , linked ui created in pyqt designer. when opening feature form, see frame, no image. after reading many tutorials on steps follow, can't see missing. there done in terms of windows path environment variables?

it turns out there's interference between pyqt , gdal in terms of windows environment paths. got work after moving c:\program files\gdal end of variable value list. not sure how gdal related applications going react, however.


Comments

Popular posts from this blog

javascript - RequestAnimationFrame not working when exiting fullscreen switching space on Safari -

Python ctypes access violation with const pointer arguments -