Chapter 9. Widgets and Designer

Table of Contents

9.1. Widget Categories
9.2. Designer Introduction
9.3. Dialogs
9.4. Form Layout
9.5. Icons, Images and Resources
9.6. Layout of Widgets
9.6.1. Spacing, Stretching, and Struts
9.6.2. Size Policy and Size Hint
9.6.3. Exercises: Layout of Widgets
9.7. Designer Integration with Code
9.7.1. QtCreator Integration with Designer
9.8. Exercise: Input Forms
9.9. The Event Loop: Revisited
9.9.1. QTimer
9.9.1.1. Exercises: QTimer
9.10. Paint Events, Drawing Images
9.11. Review Questions

[ fromfile: widgets.xml id: widgets ]

Abstract

This chapter provides an overview of the GUI building blocks in the Qt library, called widgets, and includes some simple examples of how to use them. QtCreator and Designer are used to explore the widgets and their features, and to integrate forms with user code.

Figure 9.1.  QWidget's Heritage

QWidget's Heritage



[46] There are some exceptions to this rule. For example, a floating QDockWidget or QDialog can lie outside the boundaries of the parent widget, but is still "in front" of it. Section 10.2 discusses QDocWidgets.