Geographic Information Systems Stack Exchange is a question and answer site for cartographers, geographers and GIS professionals. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm unable to setup the display of the toolbar icon for a plugin in QGIS 2.0. I have compiled the "resources.qrc" with the correct path and filename, and checked possible spelling errors in the code.

In fact, the icon is displayed in the plugin manager but not on the toolbar or the dropdown menu (?). The plugin has been started using the plugin builder for 1.8 version, but works just fine. The plugin folder is linked to the qgis plugins folder by a symlink on a linux system.


Edit: my qrc file :

    <qresource prefix="/plugins/ViewshedAnalysis" >

and my code :

self.action = QAction(
        u"Viewshed", self.iface.mainWindow())
QObject.connect(self.action, SIGNAL("triggered()"),

# Add toolbar button and menu item
self.iface.addPluginToMenu(u"&Viewshed Analysis", self.action)
share|improve this question

closed as off-topic by underdark Jul 11 '15 at 21:58

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions describing a problem that can't be reproduced and seemingly went away on its own (or went away when a typo was fixed) are off-topic as they are unlikely to help future readers." – underdark
If this question can be reworded to fit the rules in the help center, please edit the question.

What do you see in the icons place? Nothing? – Nathan W Dec 10 '13 at 12:12
yes, it's empty – Zoran Dec 10 '13 at 13:06
Can you past your resources.qrc and and example of you loading the icon. – Nathan W Dec 10 '13 at 13:07
did you import your compiled resource? import resources_rc – Matthias Kuhn Dec 11 '13 at 9:10
Bingo! I do import the resources, but with a small typo ... so now it works perfectly! (I would never figure thos out :) – Zoran Dec 12 '13 at 13:26

Worked for myself as well, as Matthias suggested if you add the following to your import statements:

import resources_rc

It works as long as you have updated and recompiled your resources file:

pyrcc4 -o resources.qrc

(In windows easiest to run with the OSGeo4W shell, cd to directory)

share|improve this answer

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