[ fromfile: widgets.xml id: widgetcategories ]
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 you are likely to use as you start GUI programming.
There are four categories of basic widgets. Button widgets, in "Windows Style," are shown in Figure 9.2.
Input widgets, in "Plastique style," are shown in Figure 9.3.
Display widgets are noninteractive, such as QLabel, QProgressBar, and QPixmap.
Container widgets, such as the QMainWindow, QFrame, QToolBar, QTabWidget, and QStackedWidget, contain other widgets.
The widgets just described are used as building blocks to create other more complex widgets, such as
Dialogs for asking the user questions or popping up information, such as the QFileDialog, QInputDialog, and QErrorMessage.
Views that provide displays of collections of data such as QListView, QTreeView, QColumnView, and QTableView, all four of which are shown in Figure 9.4.
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
Qt Data types: QPoint, QSize, QColor, QImage, and QPixMap are used when working with graphical objects.
Layouts: These are objects that dynamically manage the layout of widgets. There are specific layout varieties: QHBoxLayout, QVBoxLayout, QGridLayout, QFormLayout, and so on.
Models: The QAbstractItemModel, and various derived classes such as QAbstractListModel and QAbstractTableModel, plus ready-made concrete derived classes such as QSqlQueryModel and QFileSystemModel, are part of Qt's model/view framework that has built-in mechanisms for linking a model with various views so that changes to one component are automatically transmitted to the others.
Controller classes: QApplication and QAction are both objects that manage the GUI application's control flow. QItemDelegate serves as a controller between Models and Views.
To see more widgets rendered in different styles, check out The Qt Widget Gallery, which contains a variety of screenshots and source code for rendering the widgets in different styles.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |