[Qgis-developer] Displaying help for Python plugins

Larry Shaffer larrys at dakotacarto.com
Sun May 13 09:01:51 PDT 2012

Hi Alexander,

On Sun, May 13, 2012 at 3:03 AM, Alexander Bruy <alexander.bruy at gmail.com>wrote:

> Hi all,
> regarding to PyQGIS CookBook [0] plugin documentation can
> be written as HTML files and to open help developer should
> use method showPluginHelp() from qgis.utils module.
> In same time showPluginHelp() used deprecated method openURL()
> from QgsInterface class [1]. And as I can see there are no alternatives
> for this method. So what is best solution for displaying Python plugin
> help in long-term period? Use showPluginHelp() as suggested in
> cookbook or implement own method directly in plugins?
> [0] http://www.qgis.org/pyqgis-cookbook/plugins.html#documentation
> [1]
> http://qgis.org/api/classQgisInterface.html#374a28be05fac25b26f271f7ff19cd6d

You can use QDesktopServices [0] in lieu of QGIS openURL(), but I think you
probably know this already:


As part of my Plugin Editor tools, I have designed a lightweight web
browser for displaying HTML help. It allows you to load pre-defined
bookmarks, and has several useful tools for viewing help and tutorials from
within plugins, but does not support several 'normal' browser features,
like downloads.

It is the first PyQGIS shared widget in the sister plugin to Plugin Editor,
called Plugin Library. The idea behind the Library is to offer, via a PyQt
GUI, a method to demo and browse available shared widgets, modules and
snippets. Once the Library is installed, it acts like a PyQGIS virtual
Python environment, from which other developers can use to import its
different components into their plugins. It is an attempt to share code
amongst Python plugin developers (without bothering the C++ coders to
include into the GUI core), speed the development of plugins, and offer
users similar GUIs across plugins (like a help browser).

I'm not done with the Library plugin, but I am pretty much done with the
first version of Help Browser (except for its help :^). Please download it
and try it out, if you like [1]. Right now, it is just a package, but will
later be a sub-package of the Library, accessible with:

from plugin_library.widgets.help_browser.help_browser \
                import HelpBrowser

I have only tested it on Mac (10.7 and 10.6.8). Currently, on Mac with QGIS
1.8, any access to external web sites crashes QGIS. Works locally, though.

[0] http://qt-project.org/doc/qt-4.8/qdesktopservices.html
[1] http://dl.dropbox.com/u/4058089/qgis/help_browser.zip


Larry Shaffer
Dakota Cartography
Black Hills, South Dakota
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.osgeo.org/pipermail/qgis-developer/attachments/20120513/9f06cbbc/attachment.html

More information about the Qgis-developer mailing list