[Qgis-developer] Plugin snippets & cookbook

Denis Rouzaud denis.rouzaud at gmail.com
Fri Mar 30 05:57:25 EDT 2012


Hi all,

First, I propose to add these three lines in the code snippets. It is to 
include help link in thew plugin menu:
def initGui(self):
   # This initiates the action
   self.helpAction = QAction(QIcon(":/plugins/myplugin/icons/help.png"), 
"Help", self.iface.mainWindow())
   # This will open the website url using user's defined browser
   QObject.connect(self.helpAction, SIGNAL("triggered()"), lambda: 
QDesktopServices.openUrl(QUrl("http://my.help.site/formyplugin")))
   # This will add the help link in the plugin menu, under the entry "My 
Plugin"
   self.iface.addPluginToMenu("&My plugin", self.helpAction)


What do you think?
Can someone add this or tell me how to do it?


Also, if I'd like to share a few lines of plugins for demo, what's the 
best way? A blog or code snippets in cookbook?

Thanks

Denis


More information about the Qgis-developer mailing list