[Qgis-user] Python plugin toobar icon

Möri Cedric Cedric.Moeri at bd.so.ch
Tue Apr 7 01:56:43 PDT 2009


Hello list

i'm trying to put a python plugin together. For puting my plugin/action in the toolbar and the menue I use the following snippet in def initGui(self):

self.iface.addToolBarIcon(self.action)
self.iface.addPluginToMenu("TWV",self.action)

For unloading it, I use 

def unload(self):
  self.iface.removePluginMenu("TWV",self.action)
  self.iface.removeToolBarIcon(self.action)

This works well, except when the plugin is unloaded with the plugin manager and in the same qgis session loaded again. In this case the icon (and the action) doesn't appear in the toolbar again. It works well for the plugin menue the whole time.

This is not a big problem, as the icon reappears when qgis is restarted (and the situation described is not very often, I guess).

Nevertheless, am I missing something in my code or is somekind of bug?

regards
Cédric



mit freundlichen Grüssen

Cédric Möri
GIS-Informatiker

--
Kanton Solothurn
Bau- und Justizdepartement
Amt für Geoinformation
Rötistrasse 4
4501 Solothurn

Telefon: +41 (0)32 627 24 75
Telefax: +41 (0)32 627 22 14
mailto:cedric.moeri at bd.so.ch
http://www.agi.so.ch



More information about the Qgis-user mailing list