Widget Categories

Qt widgets can be categorized in a number of ways to make it easier to find classes you are likely to use. The more complex widgets may cross over into more than one category. This section provides a brief overview of some of the classes we are likely to use as we get started with GUI programming.

There are four categories of widgets. Button widgets, in "Windows style," are shown in Figure 11.2.

Figure 11.2. Button widgets, in "Windows style"

Input widgets, in "Plastique style," are shown in Figure 11.3.

Figure 11.3. Input widgets, in "Plastique style"

Display widgets are non-interactive widgets, such as QLabel, QProgressBar, and QPixMap.

Container widgets, such as the QMainWindow, QFrame, QToolBar, QTabWidget, and QStackedWidget, contain other widgets.

These widgets are used as building blocks to create other more complex widgets, such as:

In addition, there are some Qt classes that do not have any graphical representation (so they are not widgets) but are used in GUI development. They include

To see more widgets rendered in different styles, check out TrollTech's Qt Widget Gallery1, which contains a variety of screenshots and source code for rendering the widgets in different styles.[1]

[1] http://oop.mcs.suffolk.edu/qtdocs/gallery.html

Категории