O'Reilly logo

Building Mapping Applications with QGIS by Erik Westra

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

Adding the user interface

Now that our program is running, we can start implementing the user interface (UI). A typical PyQt application will make use of Qt Designer to store the application's UI in a template file, which is then compiled into a Python module for use within your application.

As it would take many pages to describe how to use Qt Designer to lay out our window with its toolbar and menus, we're going to cheat and create our user interface directly within Python. At the same time, however, we'll create our UI module as if it was created using Qt Designer; this keeps our application's UI separate, and also shows how our application would work if we were to use Qt Designer to design our user interface.

Create a new module called ui_explorerWindow.py ...

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