When i'm loading my plugin into QGis 2.4 the icon doesn't appear in the toolbar. There is only an empty button. I have the icon.png in all the necessary files:


     <qresource prefix="/plugins/colorTransparency" >

which is compiled with pyrcc4 -o resources.py resources.qrc




 def initGui(self):
    # Create action that will start plugin configuration
    self.action = QAction(
        u"Transparency and Random Color", self.iface.mainWindow())
    #connect the action to the run method

    # Add toolbar button and menu item
    self.iface.addPluginToMenu(u"&TransparencyRandomColor", self.action)

def unload(self):
    # Remove the plugin menu item and icon
    self.iface.removePluginMenu(u"&TransparencyRandomColor", self.action)

The icon.png is in the same directory and has a size of 25px x 25px.

In the plugin installer the icon is displayed. I also tried to delete it and clean everything but it doesn't work.

  • did you compiled the resource file with Make (in case of Plugin Builder) or using directly pyrcc4 compiler? Oct 8, 2014 at 7:12
  • I've tried it with make. This did not work. Afterwards I deleted the .py file and exectued pyrcc4 manually.
    – Martin
    Oct 8, 2014 at 8:11
  • 1
    if your read the make, if try to compile resources.rc giving it name as resources_rc.py => purcc4 -o resources_rc.py resources.rc. the output .py have to be the same imported in the plugin Oct 8, 2014 at 10:29
  • Ok i did it like this and it works!
    – Martin
    Oct 21, 2014 at 8:38

2 Answers 2


The solution for me was not to use the Plugin Builder Plugin that is recommended in the PYQgis Cookbook.

When I create the files manually everything is working fine and the icon is displayed.


I had the same problem.Try picture resolution 24x24 and with less shades of color.

  • I tried it with 24x24 and a simple black square but it has no effect in the toolbox.
    – Martin
    Oct 2, 2014 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.