[Qgis-developer] Plugin icons

Martin Dobias wonder.sk at gmail.com
Sun Dec 12 14:33:08 EST 2010


Hi everyone (especially plugin developers)

I've just committed to trunk (in r14897) a bit of eye candy: plugins
can now be associated with an icon, making the plugin manager dialog
more colorful. I hope the icons will help with orientation in that
long list of plugins. Plugin developers are welcome to assign icons to
their plugins!

How to add icon for your plugin to plugin manager:
In plugin's __init__.py file add new icon() method:

def icon():
  return "images/my-icon.png"

That's all. Plugin manager will load the icon and put it next to the
plugin's name. The path to the icon should be relative to the plugin's
directory. Any image type supported by Qt is supported, though PNG is
highly preferred since it is lossless and supports transparency with
alpha channel.

At some point the new plugin repository (currently under development)
should be able to automatically parse the icon file name, retrieve the
icon from plugin's zip archive and make it available to plugin
installer to download icons for the available plugins.

Comments are welcome :-)

Regards
Martin


More information about the Qgis-developer mailing list