
We will modify it in QT Designer in a moment to adapt the GUI for our purposes. random_number_generator_dialog_base.ui: this is the class in which the GUI for our dialog box is defined.

We will talk about this class in more detail in a moment because this is the class that we are going to modify to implement what needs to happen when the user interacts with the GUI of our plugin. random_number_generator_dialog.py: this is the class that defines the main GUI widget for our plugin derived from QDialog.closed with the Ok button), then we would put that code here after the “if result:” line. If we wanted some code to be executed only if the dialog box is accepted (e.g. One central method is the method run() that in this case here shows our dialog box stored in instance variable self.dlg. If you look at the code that Plugin Builder 3 generated for this class, you will see that this class has to define a number of methods to interact with QGIS and its plugin interface. random_number_generator.py: this file defines the main class RandomNumberGenerator for our plugin.In this introduction to QGIS plugin development, we won’t go into the details of features like internationalization and test code generation, so you can ignore the different subfolders and also some of the files in the main folder. We have no intentation of publishing this plugin, so we just use “489” here.įigure 4.33 Content of the folder created by Plugin Builder for our new plugin Author/Company & Email address: here you provide information about the author of the plugin that will be used to create the copyright information at the beginning of the different files.Version number & Minimum QGIS version: these are used to specify a version number for your plugin and the minimum QGIS version required to run it.Typically, the class name written with underscores rather than in CamelCase is used here. py file that will contain the main class for your plugin. Description: a short description of what the plugin is for.In contrast to the class name, it can contain spaces and other special characters. Plugin name: this is the name of the plugin in readable form.It needs to be a valid Python class name. Class name: this is the name of the main class for our plugin.We fill out the first page as shown in the figure below. html page with detailed information on the purpose and meaning of the different fields. Clicking the “Help” button will open a local. To create a template for your plugin, you have to work through the dialog boxes of Plugin Builder and fill out the information there.

Now run the plugin by going Plugins -> Plugin Builder in the main menu.

If not, please go back to Section 4.4.1 and follow the installation instructions there. The plugin builder 3 plugin should already be installed in your QGIS version.
