Introducing Qt widgets
A widget is the basic element of a GUI. It is also known as a UI control. It accepts different user events such as mouse and keyboard events (and other events) from the underlying platform. We create UIs using different widgets. There was a time when all GUI controls were written from scratch. Qt widgets reduce time by developing a desktop GUI with ready-to-use GUI controls, and Qt widely uses the concept of inheritance. All widgets inherit from QObject
. QWidget
is a basic widget and is the base class of all UI widgets. It contains most of the properties required to describe a widget, along with properties such as geometry, color, mouse, keyboard behavior, tooltips, and so on. Let's have a look at QWidget
inheritance hierarchy in the following diagram:
Most of the Qt widget names are self-explanatory and can be identified easily as they start with Q. Some of them are listed here:
-
...