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
Part I: Introduction to C++ and Qt 4
C++ Introduction
Classes
Introduction to Qt
Lists
Functions
Inheritance and Polymorphism
Part II: Higher-Level Programming
Libraries
Introduction to Design Patterns
QObject
Generics and Containers
Qt GUI Widgets
Concurrency
Validation and Regular Expressions
Parsing XML
Meta Objects, Properties, and Reflective Programming
More Design Patterns
Models and Views
Qt SQL Classes
Part III: C++ Language Reference
Types and Expressions
Scope and Storage Class
Statements and Control Structures
Memory Access
Chapter Summary
Inheritance in Detail
Miscellaneous Topics
Part IV: Programming Assignments
MP3 Jukebox Assignments
Part V: Appendices
MP3 Jukebox Assignments
Bibliography
MP3 Jukebox Assignments