PyQt4 comes with an application called QT Designer. It is a GUI designer for QT-based applications and provides a quick way to develop a graphical user interface containing some basic widgets. With this, let's see how the Thumbnail Maker dialog looks in QT Designer and then run a command to generate Python source code from the .ui
file.
Download the
thumbnailMaker.ui
file from the Packt website.Start the QT Designer application that comes with PyQt4 installation.
Open the file
thumbnailMaker.ui
in QT Designer. Notice the red-colored borders around the UI elements in the dialog. These borders indicate a 'layout' in which the widgets are arranged. Without a layout in place, the UI elements may appear distorted when you run the application and, for instance, resize the dialog. Three types ofQLayouts
are used, namelyHorizontal
,Vertical
, andGrid
layout
.You can add new UI elements, such as a
QCheckbox
or aQLabel
, by dragging and dropping it from the...