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 am writing a python plugin for QGIS 1.7 (started it on QGIS 1.6 but switched to 1.7 recently). Since I switched to 1.7 my unload function doesn't seem to be working anymore. Whenever I implemented changes to the code I use the "Plugin Reloader" plugin to load the newest version of my code.

In the MenuBar this causes an additional, new instanec of the plugin to load while it doesn't unload the old ones. After doing this a couple of time I end up having a list of endless outdated outdated references to my plugin. For the menu bar icon the same does NOT happen...

The code worked fine in 1.6 and I seem to be correctly following all the online examples. It shouldn't be a problem, that I'm creating two actions, at least the PluginReloader plugin seems to do the same.

def initGui(self): 
    # GemEB Tool
    self.action_tool = QAction(QIcon(iconpath), u"GemEBTool", self.iface.mainWindow())
    self.iface.addPluginToMenu("&GemeindeEnergieBeratung 1.5", self.action_tool)
    QObject.connect(self.action_tool, SIGNAL("triggered()"), self.run_tool)

    # Solarrechner
    self.action_solarrechner = QAction(QIcon(iconpath), u"GemEB Solarrechner", self.iface.mainWindow())
    self.action_solarrechner.setWhatsThis(u"GemEB Solarrechner")
    self.iface.addPluginToMenu("&GemeindeEnergieBeratung 1.5", self.action_solarrechner)
    QObject.connect(self.action_solarrechner, SIGNAL("triggered()"), self.run_solarrechner)

def unload(self):
    # GemEB Tool

    # Solarrechner
    self.iface.removePluginMenu("&GemEB Solarrechner",self.action_solarrechner)        
share|improve this question
up vote 1 down vote accepted

While the menu entry is added with

self.iface.addPluginToMenu("&GemeindeEnergieBeratung 1.5", self.action_tool)

you try to remove it with


My theory would be that it doesn't work because "&GemeindeEnergieBeratung 1.5" != "&GemEBTool"

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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