[Qgis-developer] Images and button in Qt Designer

Christophe Damour sigeal at sigeal.com
Fri May 6 01:16:02 PDT 2016


You could try :
pyrcc4.exe -o resources_rc.py resources.qrc

-- 
Christophe

Le 06/05/2016 à 10:04, matteo a écrit :
> Hi guys,
>
> I'm facing a very annoying problem. In some UI of a plugin I need to 
> add some icons in a QPushButton.
>
> Qt Designer allows to add icons in 2 ways (I think):
>
> 1. by choosing the file in the computer (so a simple image)
> 2. by adding images of a resource file
>
> The 1. method doesn't give any trouble with QGIS but the icon is not 
> visible once the plugin is loaded.
>
> With the 2. method I have some problem in QGIS. Once saved the UI, Qt 
> adds the following lines to the code (interface.ui file):
>
>
> <resources>
>   <include location="resources.qrc"/>
> </resources>
>
>
> and I've compiled the resource file with:
>
>
> pyrcc4 -o resources.py resources.qrc
>
>
> without any errors.
> but this causes a crash of the plugin once loaded:
>
>
> ImportError: No module named resources_rc
>
>
> am I missing something?
>
> Thanks to all
>
> Cheers
>
> Matteo
> _______________________________________________
> Qgis-developer mailing list
> Qgis-developer at lists.osgeo.org
> List info: http://lists.osgeo.org/mailman/listinfo/qgis-developer
> Unsubscribe: http://lists.osgeo.org/mailman/listinfo/qgis-developer

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20160506/1d5a79ec/attachment.html>


More information about the Qgis-developer mailing list