Designing GUIs
So far, we have coded all the user interfaces manually by writing C++ code that instantiates widgets, arranges them in layouts, and connects signals to slots. It is not that hard for simple widgets, but becomes tedious and time-consuming when the UI becomes more and more complex. Fortunately, Qt provides tools to do all this in a more pleasant way. Instead of writing C++ code, we can create forms using a graphical tool by dragging and dropping widgets on a canvas, applying layouts to them, and even establishing signal-slot connections using the point-and-click technique. Later during the compilation, such forms will get converted into C++ code for us and will be ready for applying onto a widget.
The tool is called Qt Designer and is integrated with Qt Creator. To use it, select New File or Project from the File menu and choose the Qt Designer Form Class template available after selecting Qt in the Files and Classes section of the dialog box. You get to choose a template for...