O'Reilly logo

QGIS Python Programming Cookbook by Joel Lawhead

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Creating a QGIS plugin

Plugins are the best way to extend QGIS, as they can be easily updated and reused by other people.

Getting ready

The easiest approach to creating a plugin is to use the Plugin Builder plugin to jumpstart development. You can find it in the main QGIS plugin repository and install it.

How to do it…

Perform the following steps to create a simple plugin that displays a dialog box with a custom message:

  1. Start QGIS.
  2. From the Plugins menu, select Plugin Builder and then click on Plugin Builder under the submenu.
  3. In the QGIS Plugin Builder dialog, name the class MyPlugin.
  4. Name the plugin My Plugin.
  5. Type a short description, such as A demonstration on building a QGIS Plugin.
  6. Enter myplugin for the Module name.
  7. Leave the default version numbers ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required