17.3 Qt WIDGETS


17.3 Qt WIDGETS

What is referred to as a component in Java AWT/Swing is usually called a widget in the C++-based Qt (and also in the C-based GNOME/GTK+ to be discussed in the next section).[6] Qt widgets are objects of type QObject. These widgets lend themselves to the same sort of categorization that we showed earlier for AWT/Swing. Examples of top-level widgets would be QFrame, QDialog, QFileDialog, and so on. Intermediate containers, intended mostly for organizing the more atomic widgets, include QGroupBox, QHBox, QVBox, and so on. There are very many atomic widgets; for example, QButton, QStatusBar, QLabel and so on. Example of the utility classes include QApplication, QSocket, QLayout, and so on.

As will be illustrated later with the help of examples, every Qt GUI program must at the very outset create a QApplication object whose job is to provide default initializations for the various parameters of an interface and to manage the flow of events between the various widgets as a human interacts with the widgets. The widgets that you actually display are objects of type QWidget.

[6]We will use the terms ‘widget' and ‘component' interchangeably from now on in the context of GUI programming.




Programming With Objects[c] A Comparative Presentation of Object-Oriented Programming With C++ and Java
Programming with Objects: A Comparative Presentation of Object Oriented Programming with C++ and Java
ISBN: 0471268526
EAN: 2147483647
Year: 2005
Pages: 273
Authors: Avinash Kak

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net