Designing the plugin's GUI
Our plugin will have two dialogs: one is the main plugin dialog, which will be used to accept user input, and the second is the so-called About dialog, with some information about the plugin.
The Qt framework, on top of which QGIS is built, provides a special program for designing dialogs and other UI elements, such as dock widgets. It is called Qt Designer. Qt Designer is a user-friendly and easy-to-use visual form designer. With its help, you can create a dialog without writing code, by placing GUI widgets on the form using your mouse. The form definition in XML format is then saved in a .ui
file, which is used by the plugin or application to construct a user interface.
To keep the plugin's structure clean, we will put all the .ui
files in a separate subdirectory, called ui
for example, in the plugin source tree.
Designing the About dialog
Start Qt Designer. In the New form welcome dialog, select the template called Dialog with Buttons Bottom, like this:
If this dialog...