Creating GUI in Qt
As described in Chapter 1, Introduction to Qt, Qt consists of multiple modules. In this chapter, you will learn how to use the Qt Widgets module. It allows you to create classic desktop applications. The user interface (UI) of these applications consists of widgets.
A widget is a fragment of the UI with a specific look and behavior. Qt provides a lot of built-in widgets that are widely used in applications: labels, text boxes, checkboxes, buttons, and so on. Each of these widgets is represented as an instance of a C++ class derived from QWidget
and provides methods for reading and writing the widget's content. You may also create your own widgets with custom content and behavior.
The base class of QWidget
is QObject
—the most important Qt class that contains multiple useful features. In particular, it implements parent–child relationships between objects, allowing you to organize a collection of objects in your program. Each object can have a parent object and an arbitrary...