1// Copyright (C) 2020 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GFDL-1.3-no-invariants-only
5\page qtwidgets-index.html
7\brief A module which provides a set of C++ technologies for building user
10 The \l {Qt Widgets C++ Classes}{Qt Widgets Module} provides a set of UI
11 elements to create classic desktop-style user interfaces. See the
12 \l {User Interfaces} overview for more information on using widgets.
16 Widgets are the primary elements for creating user interfaces in Qt.
17 \l{The Widget Classes}{Widgets} can display data and status information,
18 receive user input, and provide a container for other widgets that
19 should be grouped together. A widget that is not embedded in a
20 parent widget is called a \l{Window and Dialog Widgets} {window}.
22 \image parent-child-widgets.png A parent widget containing various child widgets.
24 The QWidget class provides the basic capability to render to the
25 screen, and to handle user input events. All UI elements that Qt
26 provides are either subclasses of QWidget, or are used in connection
27 with a QWidget subclass. Creating custom widgets is done by
28 subclassing QWidget or a suitable subclass and reimplementing the
29 virtual event handlers.
32 \li \l{Window and Dialog Widgets}
33 \li \l{Application Main Window}
34 \li \l{Dialog Windows}
35 \li \l{Keyboard Focus in Widgets}
40 \l{Styles and Style Aware Widgets}{Styles} draw on behalf of
41 widgets and encapsulate the look and feel of a GUI. Qt's built-in
42 widgets use the QStyle class to perform nearly all of their drawing,
43 ensuring that they look exactly like the equivalent native widgets.
47 \li \image windowsvista-tabwidget.png
48 \li \image fusion-tabwidget.png
49 \li \image macos-tabwidget.png
52 \l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
53 appearance of widgets, in addition to what is already possible by subclassing QStyle.
58 \l{Layout Management}{Layouts} are an elegant and flexible way to
59 automatically arrange child widgets within their container. Each
60 widget reports its size requirements to the layout through the
61 \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy} properties,
62 and the layout distributes the available space accordingly.
66 \li \image qgridlayout-with-5-children.png
67 \li \image qformlayout-with-6-children.png
70 \l {Qt Designer} is a powerful tool for interactively creating and
71 arranging widgets in layouts.
75 \section1 Model/View Classes
77 The \l{Model/View Programming}{model/view} architecture provides classes
78 that manage the way data is presented to the user. Data-driven applications
79 which use lists and tables are structured to separate the data and view
80 using models, views, and delegates.
82 \image windows-treeview.png
84 \section1 Graphics View
86 The \l{Graphics View Framework} is for managing and interacting with a large
87 number of custom-made 2D graphical items, and a view widget for visualizing
88 the items, with support for zooming and rotation.
90 \image graphicsview-items.png
92 \section1 Using the Module
94 \include {module-use.qdocinc} {using the c++ api}
96 \section2 Building with CMake
98 \include {module-use.qdocinc} {building with cmake} {Widgets}
100 \section2 Building with qmake
102 \include {module-use.qdocinc} {building_with_qmake} {widgets}
104 \section1 Articles and Guides
107 \li \l{Widgets Tutorial}
108 \li \l{Getting Started Programming with Qt Widgets}
109 \li \l{Creating a Qt Widget Based Application}
110 \li \l{Model/View Tutorial}
116 \li \l{Qt Widgets Examples}
117 \li \l{Layout Examples}
118 \li \l{Tools Examples}
121 \section1 API Reference
124 \li \l{Qt Widgets C++ Classes}
126 \li \l{Basic Widget Classes}
127 \li \l{Advanced Widget Classes}
128 \li \l{Abstract Widget Classes}
129 \li \l{Organizer Widget Classes}
130 \li \l{Graphics View Classes}
131 \li \l{Model/View Classes}
132 \li \l{Main Window and Related Classes}
133 \li \l{Widget Appearance and Style Related Classes}
134 \li \l{Layout Classes}
136 \li \l{Qt Style Sheets Reference}
139 \section1 Module Evolution
141 \l{Changes to Qt Widgets} lists important changes in the module API
142 and functionality that were done for the Qt 6 series of Qt.
146 The Qt Widgets module is available under commercial licenses from \l{The Qt Company}.
147 In addition, it is available under free software licenses:
148 The \l{GNU Lesser General Public License, version 3}, or
149 the \l{GNU General Public License, version 2}.
150 See \l{Qt Licensing} for further details.