0
|
1 |
/****************************************************************************
|
|
2 |
**
|
|
3 |
** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
|
|
4 |
** All rights reserved.
|
|
5 |
** Contact: Nokia Corporation (qt-info@nokia.com)
|
|
6 |
**
|
|
7 |
** This file is part of the documentation of the Qt Toolkit.
|
|
8 |
**
|
|
9 |
** $QT_BEGIN_LICENSE:LGPL$
|
|
10 |
** No Commercial Usage
|
|
11 |
** This file contains pre-release code and may not be distributed.
|
|
12 |
** You may use this file in accordance with the terms and conditions
|
|
13 |
** contained in the Technology Preview License Agreement accompanying
|
|
14 |
** this package.
|
|
15 |
**
|
|
16 |
** GNU Lesser General Public License Usage
|
|
17 |
** Alternatively, this file may be used under the terms of the GNU Lesser
|
|
18 |
** General Public License version 2.1 as published by the Free Software
|
|
19 |
** Foundation and appearing in the file LICENSE.LGPL included in the
|
|
20 |
** packaging of this file. Please review the following information to
|
|
21 |
** ensure the GNU Lesser General Public License version 2.1 requirements
|
|
22 |
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
|
|
23 |
**
|
|
24 |
** In addition, as a special exception, Nokia gives you certain additional
|
|
25 |
** rights. These rights are described in the Nokia Qt LGPL Exception
|
|
26 |
** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
|
|
27 |
**
|
|
28 |
** If you have questions regarding the use of this file, please contact
|
|
29 |
** Nokia at qt-info@nokia.com.
|
|
30 |
**
|
|
31 |
**
|
|
32 |
**
|
|
33 |
**
|
|
34 |
**
|
|
35 |
**
|
|
36 |
**
|
|
37 |
**
|
|
38 |
** $QT_END_LICENSE$
|
|
39 |
**
|
|
40 |
****************************************************************************/
|
|
41 |
|
|
42 |
/*!
|
|
43 |
\page widgets-and-layouts.html
|
|
44 |
\title Widgets and Layouts
|
|
45 |
|
|
46 |
\ingroup frameworks-technologies
|
|
47 |
|
|
48 |
\nextpage Widget Classes
|
|
49 |
|
|
50 |
The primary elements for designing user interfaces in Qt are widgets and layouts.
|
|
51 |
|
|
52 |
\section1 Widgets
|
|
53 |
|
|
54 |
\l{Widget Classes}{Widgets} can display data and status information, receive
|
|
55 |
user input, and provide a container for other widgets that should be grouped
|
|
56 |
together. A widget that is not embedded in a parent widget is called a
|
|
57 |
\l{Application Windows and Dialogs}{window}.
|
|
58 |
|
|
59 |
\image parent-child-widgets.png A parent widget containing various child widgets.
|
|
60 |
|
|
61 |
The QWidget class provides the basic capability to render to the screen, and to
|
|
62 |
handle user input events. All UI elements that Qt provides are either subclasses
|
|
63 |
of QWidget, or are used in connection with a QWidget subclass. Creating custom
|
|
64 |
widgets is done by subclassing QWidget or a suitable subclass and reimplementing
|
|
65 |
the virtual event handlers.
|
|
66 |
|
|
67 |
\section1 Layouts
|
|
68 |
|
|
69 |
\l{Layout Management}{Layouts} are an elegant and flexible way to automatically
|
|
70 |
arrange child widgets within their container. Each widget reports its size requirements
|
|
71 |
to the layout through the \l{QWidget::}{sizeHint} and \l{QWidget::}{sizePolicy}
|
|
72 |
properties, and the layout distributes the available space accordingly.
|
|
73 |
|
|
74 |
\table
|
|
75 |
\row
|
|
76 |
\o \image qgridlayout-with-5-children.png
|
|
77 |
\o \image qformlayout-with-6-children.png
|
|
78 |
\endtable
|
|
79 |
|
|
80 |
\l{Qt Designer Manual}{\QD} is a powerful tool for interactively creating and
|
|
81 |
arranging widgets in layouts.
|
|
82 |
|
|
83 |
\section1 Widget Styles
|
|
84 |
|
|
85 |
\l{Implementing Styles and Style Aware Widgets}{Styles} draw on behalf of widgets
|
|
86 |
and encapsulate the look and feel of a GUI. Qt's built-in widgets use the QStyle
|
|
87 |
class to perform nearly all of their drawing, ensuring that they look exactly like
|
|
88 |
the equivalent native widgets.
|
|
89 |
|
|
90 |
\table
|
|
91 |
\row
|
|
92 |
\o \image windowsxp-tabwidget.png
|
|
93 |
\o \image plastique-tabwidget.png
|
|
94 |
\o \image macintosh-tabwidget.png
|
|
95 |
\endtable
|
|
96 |
|
|
97 |
\l{Qt Style Sheets} are a powerful mechanism that allows you to customize the
|
|
98 |
appearance of widgets, in addition to what is already possible by subclassing QStyle.
|
|
99 |
*/
|
|
100 |
|
|
101 |
/*!
|
|
102 |
\page widget-classes.html
|
|
103 |
\title Widget Classes
|
|
104 |
|
|
105 |
\contentspage Widgets and Layouts
|
|
106 |
\nextpage Layout Management
|
|
107 |
|
|
108 |
Below you find a list of all widget classes in Qt. You can also browse the
|
|
109 |
widget classes Qt provides in the various supported styles in the
|
|
110 |
\l{Qt Widget Gallery}.
|
|
111 |
|
|
112 |
\tableofcontents
|
|
113 |
|
|
114 |
\section1 Basic Widgets
|
|
115 |
|
|
116 |
These basic widgets (controls), such as buttons, comboboxes and scroll bars, are
|
|
117 |
designed for direct use.
|
|
118 |
|
|
119 |
\table
|
|
120 |
\row
|
|
121 |
\o \image windows-label.png
|
|
122 |
\o \image windowsvista-pushbutton.png
|
|
123 |
\o \image gtk-progressbar.png
|
|
124 |
\row
|
|
125 |
\o \image plastique-combobox.png
|
|
126 |
\o \image macintosh-radiobutton.png
|
|
127 |
\o \image cde-lineedit.png
|
|
128 |
\endtable
|
|
129 |
|
|
130 |
\annotatedlist basicwidgets
|
|
131 |
|
|
132 |
\section1 Advanced Widgets
|
|
133 |
|
|
134 |
Advanced GUI widgets such as tab widgets and progress bars provide more
|
|
135 |
complex user interface controls.
|
|
136 |
|
|
137 |
\table
|
|
138 |
\row
|
|
139 |
\o \image windowsxp-treeview.png
|
|
140 |
\o \image gtk-calendarwidget.png
|
|
141 |
\o \image qundoview.png
|
|
142 |
\endtable
|
|
143 |
|
|
144 |
\annotatedlist advanced
|
|
145 |
|
|
146 |
\table
|
|
147 |
\row
|
|
148 |
\o \image windowsvista-tabwidget.png
|
|
149 |
\o \image macintosh-groupbox.png
|
|
150 |
\endtable
|
|
151 |
|
|
152 |
\section1 Organizer Widgets
|
|
153 |
|
|
154 |
Classes like splitters, tab bars, button groups, etc are used to
|
|
155 |
organize and group GUI primitives into more complex applications or
|
|
156 |
dialogs.
|
|
157 |
|
|
158 |
\annotatedlist organizers
|
|
159 |
|
|
160 |
\section1 Abstract Widget Classes
|
|
161 |
|
|
162 |
Abstract widget classes usable through subclassing. They are generally
|
|
163 |
not usable in themselves, but provide functionality that can be used
|
|
164 |
by inheriting these classes.
|
|
165 |
|
|
166 |
\annotatedlist abstractwidgets
|
|
167 |
*/
|
|
168 |
|
|
169 |
/*!
|
|
170 |
\group advanced
|
|
171 |
\title Advanced Widgets
|
|
172 |
*/
|
|
173 |
|
|
174 |
/*!
|
|
175 |
\group abstractwidgets
|
|
176 |
\title Abstract Widget Classes
|
|
177 |
*/
|
|
178 |
|
|
179 |
/*!
|
|
180 |
\group basicwidgets
|
|
181 |
\title Basic Widgets
|
|
182 |
*/
|
|
183 |
|
|
184 |
/*!
|
|
185 |
\group organizers
|
|
186 |
\title Organizers
|
|
187 |
*/
|