Forms Architecture

Detailed Description

A Forms application creates windows and controls, processes platform events, and runs the event loop. The inherited event loop also supports I/O, timers, and asynchronous operations.

Application is the runtime root. It provides the main Screen, which represents a display and owns its top-level WindowManager. A WindowManager can also be embedded in a Workspace. Windows attach to a window manager; each window is a Form that acts as the root of one control tree.

The following diagram shows the class hierarchy. It does not describe the runtime parent relationship between controls.

Widget
View
Form
Window
Control
Layout

The runtime containment model is separate from that hierarchy:

Application -> Screen -> Window -> Form -> content Control -> child Controls

Screen and View are Widget types. A widget supplies the common geometry, visibility, repainting, scaling, screen-connection, and event-processing behavior. The platform backend submits events to the application event loop, which dispatches them to widgets. Every widget is also a Responder. This lets input events travel through the responder chain.

Form and Control are View types. A form has one main content control; a control can have several child controls. Together, these controls form the visible user interface. A form is the layout root for its content tree, while each control is responsible for the geometry of its direct children. Layouting happens in two passes. The first pass determines the space each control needs. The second pass arranges the controls within the available space.

A view provides a PaintSurface for its attached controls and translates coordinates at the boundary between the view and each control. A window is connected to the paint surface supplied by its internal WindowFrame. The frame uses a pixmap surface that the display presents after painting.

Changes to visual state or layout normally request a repaint. The repaint request travels upward through the views to the window and its window frame. Painting then travels downward again: the window paints its content, and forms and controls paint their visible children.

Classes

class  Application
 Main element of a Pt::Forms graphical user interface. More...
 
class  Control
 A view that can be attached as application content. More...
 
class  Form
 A view that hosts one content control and manages its form state. More...
 
class  Layout
 A control that arranges child controls. More...
 
class  Screen
 Screen of a display. More...
 
class  View
 A widget that connects controls to a paint surface. More...
 
class  Widget
 Common base for objects that participate in the Forms runtime. More...
 
class  Window
 Window base class. More...