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 QtGui module 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 |
#include "qstyleoption.h"
|
|
43 |
#include "qapplication.h"
|
|
44 |
#ifdef Q_WS_MAC
|
|
45 |
# include "private/qt_mac_p.h"
|
|
46 |
# include "qmacstyle_mac.h"
|
|
47 |
#endif
|
|
48 |
#ifndef QT_NO_DEBUG
|
|
49 |
#include <qdebug.h>
|
|
50 |
#endif
|
|
51 |
#include <QtCore/qmath.h>
|
|
52 |
|
|
53 |
QT_BEGIN_NAMESPACE
|
|
54 |
|
|
55 |
/*!
|
|
56 |
\class QStyleOption
|
|
57 |
\brief The QStyleOption class stores the parameters used by QStyle functions.
|
|
58 |
|
|
59 |
\ingroup appearance
|
|
60 |
|
|
61 |
QStyleOption and its subclasses contain all the information that
|
|
62 |
QStyle functions need to draw a graphical element.
|
|
63 |
|
|
64 |
For performance reasons, there are few member functions and the
|
|
65 |
access to the member variables is direct (i.e., using the \c . or
|
|
66 |
\c -> operator). This low-level feel makes the structures
|
|
67 |
straightforward to use and emphasizes that these are simply
|
|
68 |
parameters used by the style functions.
|
|
69 |
|
|
70 |
The caller of a QStyle function usually creates QStyleOption
|
|
71 |
objects on the stack. This combined with Qt's extensive use of
|
|
72 |
\l{implicit sharing} for types such as QString, QPalette, and
|
|
73 |
QColor ensures that no memory allocation needlessly takes place.
|
|
74 |
|
|
75 |
The following code snippet shows how to use a specific
|
|
76 |
QStyleOption subclass to paint a push button:
|
|
77 |
|
|
78 |
\snippet doc/src/snippets/qstyleoption/main.cpp 0
|
|
79 |
|
|
80 |
In our example, the control is a QStyle::CE_PushButton, and
|
|
81 |
according to the QStyle::drawControl() documentation the
|
|
82 |
corresponding class is QStyleOptionButton.
|
|
83 |
|
|
84 |
When reimplementing QStyle functions that take a QStyleOption
|
|
85 |
parameter, you often need to cast the QStyleOption to a subclass.
|
|
86 |
For safety, you can use qstyleoption_cast() to ensure that the
|
|
87 |
pointer type is correct. For example:
|
|
88 |
|
|
89 |
\snippet doc/src/snippets/qstyleoption/main.cpp 4
|
|
90 |
|
|
91 |
The qstyleoption_cast() function will return 0 if the object to
|
|
92 |
which \c option points is not of the correct type.
|
|
93 |
|
|
94 |
For an example demonstrating how style options can be used, see
|
|
95 |
the \l {widgets/styles}{Styles} example.
|
|
96 |
|
|
97 |
\sa QStyle, QStylePainter
|
|
98 |
*/
|
|
99 |
|
|
100 |
/*!
|
|
101 |
\enum QStyleOption::OptionType
|
|
102 |
|
|
103 |
This enum is used internally by QStyleOption, its subclasses, and
|
|
104 |
qstyleoption_cast() to determine the type of style option. In
|
|
105 |
general you do not need to worry about this unless you want to
|
|
106 |
create your own QStyleOption subclass and your own styles.
|
|
107 |
|
|
108 |
\value SO_Button \l QStyleOptionButton
|
|
109 |
\value SO_ComboBox \l QStyleOptionComboBox
|
|
110 |
\value SO_Complex \l QStyleOptionComplex
|
|
111 |
\value SO_Default QStyleOption
|
|
112 |
\value SO_DockWidget \l QStyleOptionDockWidget
|
|
113 |
\value SO_FocusRect \l QStyleOptionFocusRect
|
|
114 |
\value SO_Frame \l QStyleOptionFrame \l QStyleOptionFrameV2
|
|
115 |
\value SO_GraphicsItem \l QStyleOptionGraphicsItem
|
|
116 |
\value SO_GroupBox \l QStyleOptionGroupBox
|
|
117 |
\value SO_Header \l QStyleOptionHeader
|
|
118 |
\value SO_MenuItem \l QStyleOptionMenuItem
|
|
119 |
\value SO_ProgressBar \l QStyleOptionProgressBar \l QStyleOptionProgressBarV2
|
|
120 |
\value SO_RubberBand \l QStyleOptionRubberBand
|
|
121 |
\value SO_SizeGrip \l QStyleOptionSizeGrip
|
|
122 |
\value SO_Slider \l QStyleOptionSlider
|
|
123 |
\value SO_SpinBox \l QStyleOptionSpinBox
|
|
124 |
\value SO_Tab \l QStyleOptionTab
|
|
125 |
\value SO_TabBarBase \l QStyleOptionTabBarBase
|
|
126 |
\value SO_TabWidgetFrame \l QStyleOptionTabWidgetFrame
|
|
127 |
\value SO_TitleBar \l QStyleOptionTitleBar
|
|
128 |
\value SO_ToolBar \l QStyleOptionToolBar
|
|
129 |
\value SO_ToolBox \l QStyleOptionToolBox
|
|
130 |
\value SO_ToolButton \l QStyleOptionToolButton
|
|
131 |
\value SO_ViewItem \l QStyleOptionViewItem (used in Interviews)
|
|
132 |
|
|
133 |
The following values are used for custom controls:
|
|
134 |
|
|
135 |
\value SO_CustomBase Reserved for custom QStyleOptions;
|
|
136 |
all custom controls values must be above this value
|
|
137 |
\value SO_ComplexCustomBase Reserved for custom QStyleOptions;
|
|
138 |
all custom complex controls values must be above this value
|
|
139 |
|
|
140 |
Some style options are defined for various Qt3Support controls:
|
|
141 |
|
|
142 |
\value SO_Q3DockWindow \l QStyleOptionQ3DockWindow
|
|
143 |
\value SO_Q3ListView \l QStyleOptionQ3ListView
|
|
144 |
\value SO_Q3ListViewItem \l QStyleOptionQ3ListViewItem
|
|
145 |
|
|
146 |
\sa type
|
|
147 |
*/
|
|
148 |
|
|
149 |
/*!
|
|
150 |
Constructs a QStyleOption with the specified \a version and \a
|
|
151 |
type.
|
|
152 |
|
|
153 |
The version has no special meaning for QStyleOption; it can be
|
|
154 |
used by subclasses to distinguish between different version of
|
|
155 |
the same option type.
|
|
156 |
|
|
157 |
The \l state member variable is initialized to
|
|
158 |
QStyle::State_None.
|
|
159 |
|
|
160 |
\sa version, type
|
|
161 |
*/
|
|
162 |
|
|
163 |
QStyleOption::QStyleOption(int version, int type)
|
|
164 |
: version(version), type(type), state(QStyle::State_None),
|
|
165 |
direction(QApplication::layoutDirection()), fontMetrics(QFont())
|
|
166 |
{
|
|
167 |
}
|
|
168 |
|
|
169 |
|
|
170 |
/*!
|
|
171 |
Destroys this style option object.
|
|
172 |
*/
|
|
173 |
QStyleOption::~QStyleOption()
|
|
174 |
{
|
|
175 |
}
|
|
176 |
|
|
177 |
/*!
|
|
178 |
\fn void QStyleOption::initFrom(const QWidget *widget)
|
|
179 |
\since 4.1
|
|
180 |
|
|
181 |
Initializes the \l state, \l direction, \l rect, \l palette, and
|
|
182 |
\l fontMetrics member variables based on the specified \a widget.
|
|
183 |
|
|
184 |
This is a convenience function; the member variables can also be
|
|
185 |
initialized manually.
|
|
186 |
|
|
187 |
\sa QWidget::layoutDirection(), QWidget::rect(),
|
|
188 |
QWidget::palette(), QWidget::fontMetrics()
|
|
189 |
*/
|
|
190 |
|
|
191 |
/*!
|
|
192 |
\obsolete
|
|
193 |
|
|
194 |
Use initFrom(\a widget) instead.
|
|
195 |
*/
|
|
196 |
void QStyleOption::init(const QWidget *widget)
|
|
197 |
{
|
|
198 |
QWidget *window = widget->window();
|
|
199 |
state = QStyle::State_None;
|
|
200 |
if (widget->isEnabled())
|
|
201 |
state |= QStyle::State_Enabled;
|
|
202 |
if (widget->hasFocus())
|
|
203 |
state |= QStyle::State_HasFocus;
|
|
204 |
if (window->testAttribute(Qt::WA_KeyboardFocusChange))
|
|
205 |
state |= QStyle::State_KeyboardFocusChange;
|
|
206 |
if (widget->underMouse())
|
|
207 |
state |= QStyle::State_MouseOver;
|
|
208 |
if (window->isActiveWindow())
|
|
209 |
state |= QStyle::State_Active;
|
|
210 |
if (widget->isWindow())
|
|
211 |
state |= QStyle::State_Window;
|
|
212 |
#ifdef Q_WS_MAC
|
|
213 |
extern bool qt_mac_can_clickThrough(const QWidget *w); //qwidget_mac.cpp
|
|
214 |
if (!(state & QStyle::State_Active) && !qt_mac_can_clickThrough(widget))
|
|
215 |
state &= ~QStyle::State_Enabled;
|
|
216 |
|
|
217 |
switch (QMacStyle::widgetSizePolicy(widget)) {
|
|
218 |
case QMacStyle::SizeSmall:
|
|
219 |
state |= QStyle::State_Small;
|
|
220 |
break;
|
|
221 |
case QMacStyle::SizeMini:
|
|
222 |
state |= QStyle::State_Mini;
|
|
223 |
break;
|
|
224 |
default:
|
|
225 |
;
|
|
226 |
}
|
|
227 |
#endif
|
|
228 |
#ifdef QT_KEYPAD_NAVIGATION
|
|
229 |
if (widget->hasEditFocus())
|
|
230 |
state |= QStyle::State_HasEditFocus;
|
|
231 |
#endif
|
|
232 |
|
|
233 |
direction = widget->layoutDirection();
|
|
234 |
rect = widget->rect();
|
|
235 |
palette = widget->palette();
|
|
236 |
fontMetrics = widget->fontMetrics();
|
|
237 |
}
|
|
238 |
|
|
239 |
/*!
|
|
240 |
Constructs a copy of \a other.
|
|
241 |
*/
|
|
242 |
QStyleOption::QStyleOption(const QStyleOption &other)
|
|
243 |
: version(Version), type(Type), state(other.state),
|
|
244 |
direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics),
|
|
245 |
palette(other.palette)
|
|
246 |
{
|
|
247 |
}
|
|
248 |
|
|
249 |
/*!
|
|
250 |
Assign \a other to this QStyleOption.
|
|
251 |
*/
|
|
252 |
QStyleOption &QStyleOption::operator=(const QStyleOption &other)
|
|
253 |
{
|
|
254 |
state = other.state;
|
|
255 |
direction = other.direction;
|
|
256 |
rect = other.rect;
|
|
257 |
fontMetrics = other.fontMetrics;
|
|
258 |
palette = other.palette;
|
|
259 |
return *this;
|
|
260 |
}
|
|
261 |
|
|
262 |
/*!
|
|
263 |
\enum QStyleOption::StyleOptionType
|
|
264 |
|
|
265 |
This enum is used to hold information about the type of the style option, and
|
|
266 |
is defined for each QStyleOption subclass.
|
|
267 |
|
|
268 |
\value Type The type of style option provided (\l{SO_Default} for
|
|
269 |
this class).
|
|
270 |
|
|
271 |
The type is used internally by QStyleOption, its subclasses, and
|
|
272 |
qstyleoption_cast() to determine the type of style option. In
|
|
273 |
general you do not need to worry about this unless you want to
|
|
274 |
create your own QStyleOption subclass and your own styles.
|
|
275 |
|
|
276 |
\sa StyleOptionVersion
|
|
277 |
*/
|
|
278 |
|
|
279 |
/*!
|
|
280 |
\enum QStyleOption::StyleOptionVersion
|
|
281 |
|
|
282 |
This enum is used to hold information about the version of the style option, and
|
|
283 |
is defined for each QStyleOption subclass.
|
|
284 |
|
|
285 |
\value Version 1
|
|
286 |
|
|
287 |
The version is used by QStyleOption subclasses to implement
|
|
288 |
extensions without breaking compatibility. If you use
|
|
289 |
qstyleoption_cast(), you normally do not need to check it.
|
|
290 |
|
|
291 |
\sa StyleOptionType
|
|
292 |
*/
|
|
293 |
|
|
294 |
/*!
|
|
295 |
\variable QStyleOption::palette
|
|
296 |
\brief the palette that should be used when painting the control
|
|
297 |
|
|
298 |
By default, the application's default palette is used.
|
|
299 |
|
|
300 |
\sa initFrom()
|
|
301 |
*/
|
|
302 |
|
|
303 |
/*!
|
|
304 |
\variable QStyleOption::direction
|
|
305 |
\brief the text layout direction that should be used when drawing text in the control
|
|
306 |
|
|
307 |
By default, the layout direction is Qt::LeftToRight.
|
|
308 |
|
|
309 |
\sa initFrom()
|
|
310 |
*/
|
|
311 |
|
|
312 |
/*!
|
|
313 |
\variable QStyleOption::fontMetrics
|
|
314 |
\brief the font metrics that should be used when drawing text in the control
|
|
315 |
|
|
316 |
By default, the application's default font is used.
|
|
317 |
|
|
318 |
\sa initFrom()
|
|
319 |
*/
|
|
320 |
|
|
321 |
/*!
|
|
322 |
\variable QStyleOption::rect
|
|
323 |
\brief the area that should be used for various calculations and painting
|
|
324 |
|
|
325 |
This can have different meanings for different types of elements.
|
|
326 |
For example, for a \l QStyle::CE_PushButton element it would be
|
|
327 |
the rectangle for the entire button, while for a \l
|
|
328 |
QStyle::CE_PushButtonLabel element it would be just the area for
|
|
329 |
the push button label.
|
|
330 |
|
|
331 |
The default value is a null rectangle, i.e. a rectangle with both
|
|
332 |
the width and the height set to 0.
|
|
333 |
|
|
334 |
\sa initFrom()
|
|
335 |
*/
|
|
336 |
|
|
337 |
/*!
|
|
338 |
\variable QStyleOption::state
|
|
339 |
\brief the style flags that are used when drawing the control
|
|
340 |
|
|
341 |
The default value is QStyle::State_None.
|
|
342 |
|
|
343 |
\sa initFrom(), QStyle::drawPrimitive(), QStyle::drawControl(),
|
|
344 |
QStyle::drawComplexControl(), QStyle::State
|
|
345 |
*/
|
|
346 |
|
|
347 |
/*!
|
|
348 |
\variable QStyleOption::type
|
|
349 |
\brief the option type of the style option
|
|
350 |
|
|
351 |
The default value is SO_Default.
|
|
352 |
|
|
353 |
\sa OptionType
|
|
354 |
*/
|
|
355 |
|
|
356 |
/*!
|
|
357 |
\variable QStyleOption::version
|
|
358 |
\brief the version of the style option
|
|
359 |
|
|
360 |
This value can be used by subclasses to implement extensions
|
|
361 |
without breaking compatibility. If you use the qstyleoption_cast()
|
|
362 |
function, you normally do not need to check it.
|
|
363 |
|
|
364 |
The default value is 1.
|
|
365 |
*/
|
|
366 |
|
|
367 |
/*!
|
|
368 |
\class QStyleOptionFocusRect
|
|
369 |
\brief The QStyleOptionFocusRect class is used to describe the
|
|
370 |
parameters for drawing a focus rectangle with QStyle.
|
|
371 |
|
|
372 |
For performance reasons, the access to the member variables is
|
|
373 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
374 |
makes the structures straightforward to use and emphasizes that
|
|
375 |
these are simply parameters used by the style functions.
|
|
376 |
|
|
377 |
For an example demonstrating how style options can be used, see
|
|
378 |
the \l {widgets/styles}{Styles} example.
|
|
379 |
|
|
380 |
\sa QStyleOption
|
|
381 |
*/
|
|
382 |
|
|
383 |
/*!
|
|
384 |
Constructs a QStyleOptionFocusRect, initializing the members
|
|
385 |
variables to their default values.
|
|
386 |
*/
|
|
387 |
|
|
388 |
QStyleOptionFocusRect::QStyleOptionFocusRect()
|
|
389 |
: QStyleOption(Version, SO_FocusRect)
|
|
390 |
{
|
|
391 |
state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
|
|
392 |
}
|
|
393 |
|
|
394 |
/*!
|
|
395 |
\internal
|
|
396 |
*/
|
|
397 |
QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
|
|
398 |
: QStyleOption(version, SO_FocusRect)
|
|
399 |
{
|
|
400 |
state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
|
|
401 |
}
|
|
402 |
|
|
403 |
/*!
|
|
404 |
\enum QStyleOptionFocusRect::StyleOptionType
|
|
405 |
|
|
406 |
This enum is used to hold information about the type of the style option, and
|
|
407 |
is defined for each QStyleOption subclass.
|
|
408 |
|
|
409 |
\value Type The type of style option provided (\l{SO_FocusRect} for this class).
|
|
410 |
|
|
411 |
The type is used internally by QStyleOption, its subclasses, and
|
|
412 |
qstyleoption_cast() to determine the type of style option. In
|
|
413 |
general you do not need to worry about this unless you want to
|
|
414 |
create your own QStyleOption subclass and your own styles.
|
|
415 |
|
|
416 |
\sa StyleOptionVersion
|
|
417 |
*/
|
|
418 |
|
|
419 |
/*!
|
|
420 |
\enum QStyleOptionFocusRect::StyleOptionVersion
|
|
421 |
|
|
422 |
This enum is used to hold information about the version of the style option, and
|
|
423 |
is defined for each QStyleOption subclass.
|
|
424 |
|
|
425 |
\value Version 1
|
|
426 |
|
|
427 |
The version is used by QStyleOption subclasses to implement
|
|
428 |
extensions without breaking compatibility. If you use
|
|
429 |
qstyleoption_cast(), you normally do not need to check it.
|
|
430 |
|
|
431 |
\sa StyleOptionType
|
|
432 |
*/
|
|
433 |
|
|
434 |
/*!
|
|
435 |
\fn QStyleOptionFocusRect::QStyleOptionFocusRect(const QStyleOptionFocusRect &other)
|
|
436 |
|
|
437 |
Constructs a copy of the \a other style option.
|
|
438 |
*/
|
|
439 |
|
|
440 |
/*!
|
|
441 |
\variable QStyleOptionFocusRect::backgroundColor
|
|
442 |
\brief the background color on which the focus rectangle is being drawn
|
|
443 |
|
|
444 |
The default value is an invalid color with the RGB value (0, 0,
|
|
445 |
0). An invalid color is a color that is not properly set up for
|
|
446 |
the underlying window system.
|
|
447 |
*/
|
|
448 |
|
|
449 |
/*!
|
|
450 |
\class QStyleOptionFrame
|
|
451 |
\brief The QStyleOptionFrame class is used to describe the
|
|
452 |
parameters for drawing a frame.
|
|
453 |
|
|
454 |
QStyleOptionFrame is used for drawing several built-in Qt widgets,
|
|
455 |
including QFrame, QGroupBox, QLineEdit, and QMenu. Note that to
|
|
456 |
describe the parameters necessary for drawing a frame in Qt 4.1 or
|
|
457 |
above, you must use the QStyleOptionFrameV2 subclass.
|
|
458 |
|
|
459 |
An instance of the QStyleOptionFrame class has
|
|
460 |
\l{QStyleOption::type} {type} SO_Frame and \l{QStyleOption::version}
|
|
461 |
{version} 1.
|
|
462 |
|
|
463 |
The type is used internally by QStyleOption, its subclasses, and
|
|
464 |
qstyleoption_cast() to determine the type of style option. In
|
|
465 |
general you do not need to worry about this unless you want to
|
|
466 |
create your own QStyleOption subclass and your own styles. The
|
|
467 |
version is used by QStyleOption subclasses to implement extensions
|
|
468 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
469 |
you normally do not need to check it.
|
|
470 |
|
|
471 |
If you create your own QStyle subclass, you should handle both
|
|
472 |
QStyleOptionFrame and QStyleOptionFrameV2.
|
|
473 |
|
|
474 |
For an example demonstrating how style options can be used, see
|
|
475 |
the \l {widgets/styles}{Styles} example.
|
|
476 |
|
|
477 |
\sa QStyleOptionFrameV2, QStyleOption
|
|
478 |
*/
|
|
479 |
|
|
480 |
/*!
|
|
481 |
Constructs a QStyleOptionFrame, initializing the members
|
|
482 |
variables to their default values.
|
|
483 |
*/
|
|
484 |
|
|
485 |
QStyleOptionFrame::QStyleOptionFrame()
|
|
486 |
: QStyleOption(Version, SO_Frame), lineWidth(0), midLineWidth(0)
|
|
487 |
{
|
|
488 |
}
|
|
489 |
|
|
490 |
/*!
|
|
491 |
\internal
|
|
492 |
*/
|
|
493 |
QStyleOptionFrame::QStyleOptionFrame(int version)
|
|
494 |
: QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0)
|
|
495 |
{
|
|
496 |
}
|
|
497 |
|
|
498 |
/*!
|
|
499 |
\fn QStyleOptionFrame::QStyleOptionFrame(const QStyleOptionFrame &other)
|
|
500 |
|
|
501 |
Constructs a copy of the \a other style option.
|
|
502 |
*/
|
|
503 |
|
|
504 |
/*!
|
|
505 |
\enum QStyleOptionFrame::StyleOptionType
|
|
506 |
|
|
507 |
This enum is used to hold information about the type of the style option, and
|
|
508 |
is defined for each QStyleOption subclass.
|
|
509 |
|
|
510 |
\value Type The type of style option provided (\l{SO_Frame} for this class).
|
|
511 |
|
|
512 |
The type is used internally by QStyleOption, its subclasses, and
|
|
513 |
qstyleoption_cast() to determine the type of style option. In
|
|
514 |
general you do not need to worry about this unless you want to
|
|
515 |
create your own QStyleOption subclass and your own styles.
|
|
516 |
|
|
517 |
\sa StyleOptionVersion
|
|
518 |
*/
|
|
519 |
|
|
520 |
/*!
|
|
521 |
\enum QStyleOptionFrame::StyleOptionVersion
|
|
522 |
|
|
523 |
This enum is used to hold information about the version of the style option, and
|
|
524 |
is defined for each QStyleOption subclass.
|
|
525 |
|
|
526 |
\value Version 1
|
|
527 |
|
|
528 |
The version is used by QStyleOption subclasses to implement
|
|
529 |
extensions without breaking compatibility. If you use
|
|
530 |
qstyleoption_cast(), you normally do not need to check it.
|
|
531 |
|
|
532 |
\sa StyleOptionType
|
|
533 |
*/
|
|
534 |
|
|
535 |
/*!
|
|
536 |
\variable QStyleOptionFrame::lineWidth
|
|
537 |
\brief the line width for drawing the frame
|
|
538 |
|
|
539 |
The default value is 0.
|
|
540 |
|
|
541 |
\sa QFrame::lineWidth
|
|
542 |
*/
|
|
543 |
|
|
544 |
/*!
|
|
545 |
\variable QStyleOptionFrame::midLineWidth
|
|
546 |
\brief the mid-line width for drawing the frame
|
|
547 |
|
|
548 |
This is usually used in drawing sunken or raised frames.
|
|
549 |
|
|
550 |
The default value is 0.
|
|
551 |
|
|
552 |
\sa QFrame::midLineWidth
|
|
553 |
*/
|
|
554 |
|
|
555 |
/*!
|
|
556 |
\class QStyleOptionFrameV2
|
|
557 |
\brief The QStyleOptionFrameV2 class is used to describe the
|
|
558 |
parameters necessary for drawing a frame in Qt 4.1 or above.
|
|
559 |
|
|
560 |
\since 4.1
|
|
561 |
|
|
562 |
QStyleOptionFrameV2 inherits QStyleOptionFrame which is used for
|
|
563 |
drawing several built-in Qt widgets, including QFrame, QGroupBox,
|
|
564 |
QLineEdit, and QMenu.
|
|
565 |
|
|
566 |
An instance of the QStyleOptionFrameV2 class has
|
|
567 |
\l{QStyleOption::type} {type} SO_Frame and
|
|
568 |
\l{QStyleOption::version} {version} 2. The type is used
|
|
569 |
internally by QStyleOption, its subclasses, and
|
|
570 |
qstyleoption_cast() to determine the type of style option. In
|
|
571 |
general you do not need to worry about this unless you want to
|
|
572 |
create your own QStyleOption subclass and your own styles. The
|
|
573 |
version is used by QStyleOption subclasses to implement extensions
|
|
574 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
575 |
you normally do not need to check it.
|
|
576 |
|
|
577 |
If you create your own QStyle subclass, you should handle both
|
|
578 |
QStyleOptionFrame and QStyleOptionFrameV2. One way to achieve this
|
|
579 |
is to use the QStyleOptionFrameV2 copy constructor. For example:
|
|
580 |
|
|
581 |
\snippet doc/src/snippets/qstyleoption/main.cpp 1
|
|
582 |
|
|
583 |
In the example above: If the \c frameOption's version is 1, \l
|
|
584 |
FrameFeature is set to \l None for \c frameOptionV2. If \c
|
|
585 |
frameOption's version is 2, the constructor will simply copy the
|
|
586 |
\c frameOption's \l FrameFeature value.
|
|
587 |
|
|
588 |
For an example demonstrating how style options can be used, see
|
|
589 |
the \l {widgets/styles}{Styles} example.
|
|
590 |
|
|
591 |
\sa QStyleOptionFrame, QStyleOption
|
|
592 |
*/
|
|
593 |
|
|
594 |
/*!
|
|
595 |
Constructs a QStyleOptionFrameV2 object.
|
|
596 |
*/
|
|
597 |
QStyleOptionFrameV2::QStyleOptionFrameV2()
|
|
598 |
: QStyleOptionFrame(Version), features(None)
|
|
599 |
{
|
|
600 |
}
|
|
601 |
|
|
602 |
/*!
|
|
603 |
\fn QStyleOptionFrameV2::QStyleOptionFrameV2(const QStyleOptionFrameV2 &other)
|
|
604 |
|
|
605 |
Constructs a QStyleOptionFrameV2 copy of the \a other style option.
|
|
606 |
*/
|
|
607 |
|
|
608 |
/*!
|
|
609 |
\internal
|
|
610 |
*/
|
|
611 |
QStyleOptionFrameV2::QStyleOptionFrameV2(int version)
|
|
612 |
: QStyleOptionFrame(version), features(None)
|
|
613 |
{
|
|
614 |
}
|
|
615 |
|
|
616 |
/*!
|
|
617 |
Constructs a QStyleOptionFrameV2 copy of the \a other style option
|
|
618 |
which can be either of the QStyleOptionFrameV2 or
|
|
619 |
QStyleOptionFrame types.
|
|
620 |
|
|
621 |
If the \a other style option's version is 1, the new style option's \l
|
|
622 |
FrameFeature value is set to \l QStyleOptionFrameV2::None. If its
|
|
623 |
version is 2, its \l FrameFeature value is simply copied to the
|
|
624 |
new style option.
|
|
625 |
|
|
626 |
\sa version
|
|
627 |
*/
|
|
628 |
QStyleOptionFrameV2::QStyleOptionFrameV2(const QStyleOptionFrame &other)
|
|
629 |
{
|
|
630 |
QStyleOptionFrame::operator=(other);
|
|
631 |
|
|
632 |
const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
|
|
633 |
features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
|
|
634 |
version = Version;
|
|
635 |
}
|
|
636 |
|
|
637 |
/*!
|
|
638 |
Assigns the \a other style option to this style option. The \a
|
|
639 |
other style option can be either of the QStyleOptionFrameV2 or
|
|
640 |
QStyleOptionFrame types.
|
|
641 |
|
|
642 |
If the \a{other} style option's version is 1, this style option's
|
|
643 |
\l FrameFeature value is set to \l QStyleOptionFrameV2::None. If
|
|
644 |
its version is 2, its \l FrameFeature value is simply copied to
|
|
645 |
this style option.
|
|
646 |
*/
|
|
647 |
QStyleOptionFrameV2 &QStyleOptionFrameV2::operator=(const QStyleOptionFrame &other)
|
|
648 |
{
|
|
649 |
QStyleOptionFrame::operator=(other);
|
|
650 |
|
|
651 |
const QStyleOptionFrameV2 *f2 = qstyleoption_cast<const QStyleOptionFrameV2 *>(&other);
|
|
652 |
features = f2 ? f2->features : FrameFeatures(QStyleOptionFrameV2::None);
|
|
653 |
version = Version;
|
|
654 |
return *this;
|
|
655 |
}
|
|
656 |
|
|
657 |
/*!
|
|
658 |
\enum QStyleOptionFrameV2::FrameFeature
|
|
659 |
|
|
660 |
This enum describes the different types of features a frame can have.
|
|
661 |
|
|
662 |
\value None Indicates a normal frame.
|
|
663 |
\value Flat Indicates a flat frame.
|
|
664 |
*/
|
|
665 |
|
|
666 |
/*!
|
|
667 |
\variable QStyleOptionFrameV2::features
|
|
668 |
\brief a bitwise OR of the features that describe this frame.
|
|
669 |
|
|
670 |
\sa FrameFeature
|
|
671 |
*/
|
|
672 |
|
|
673 |
/*!
|
|
674 |
\enum QStyleOptionFrameV2::StyleOptionVersion
|
|
675 |
|
|
676 |
This enum is used to hold information about the version of the
|
|
677 |
style option, and is defined for each QStyleOption subclass.
|
|
678 |
|
|
679 |
\value Version 2
|
|
680 |
|
|
681 |
The version is used by QStyleOption subclasses to implement
|
|
682 |
extensions without breaking compatibility. If you use
|
|
683 |
qstyleoption_cast(), you normally do not need to check it.
|
|
684 |
|
|
685 |
\sa StyleOptionType
|
|
686 |
*/
|
|
687 |
|
|
688 |
/*!
|
|
689 |
\class QStyleOptionFrameV3
|
|
690 |
\brief The QStyleOptionFrameV3 class is used to describe the
|
|
691 |
parameters necessary for drawing a frame in Qt 4.1 or above.
|
|
692 |
|
|
693 |
\since 4.5
|
|
694 |
|
|
695 |
QStyleOptionFrameV3 inherits QStyleOptionFrameV2
|
|
696 |
|
|
697 |
An instance of the QStyleOptionFrameV3 class has
|
|
698 |
\l{QStyleOption::type} {type} SO_Frame and
|
|
699 |
\l{QStyleOption::version} {version} 3. The type is used
|
|
700 |
internally by QStyleOption, its subclasses, and
|
|
701 |
qstyleoption_cast() to determine the type of style option. In
|
|
702 |
general you do not need to worry about this unless you want to
|
|
703 |
create your own QStyleOption subclass and your own styles. The
|
|
704 |
version is used by QStyleOption subclasses to implement extensions
|
|
705 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
706 |
you normally do not need to check it.
|
|
707 |
|
|
708 |
\sa QStyleOptionFrameV2, QStyleOption
|
|
709 |
*/
|
|
710 |
|
|
711 |
/*!
|
|
712 |
Constructs a QStyleOptionFrameV3 object.
|
|
713 |
*/
|
|
714 |
QStyleOptionFrameV3::QStyleOptionFrameV3()
|
|
715 |
: QStyleOptionFrameV2(Version), frameShape(QFrame::NoFrame), unused(0)
|
|
716 |
{
|
|
717 |
}
|
|
718 |
|
|
719 |
/*!
|
|
720 |
\fn QStyleOptionFrameV3::QStyleOptionFrameV3(const QStyleOptionFrameV3 &other)
|
|
721 |
|
|
722 |
Constructs a QStyleOptionFrameV3 copy of the \a other style option.
|
|
723 |
*/
|
|
724 |
|
|
725 |
/*!
|
|
726 |
\internal
|
|
727 |
*/
|
|
728 |
QStyleOptionFrameV3::QStyleOptionFrameV3(int version)
|
|
729 |
: QStyleOptionFrameV2(version), frameShape(QFrame::NoFrame), unused(0)
|
|
730 |
{
|
|
731 |
}
|
|
732 |
|
|
733 |
/*!
|
|
734 |
Constructs a QStyleOptionFrameV3 copy of the \a other style option
|
|
735 |
which can be either of the QStyleOptionFrameV3 or
|
|
736 |
QStyleOptionFrame types.
|
|
737 |
|
|
738 |
If the \a other style option's version is 1, the new style
|
|
739 |
option's \l FrameFeature value is set to
|
|
740 |
\l{QStyleOptionFrameV2::None}. If its version is 2 or lower,
|
|
741 |
\l{QStyleOptionFrameV3::frameShape} value is QFrame::NoFrame
|
|
742 |
|
|
743 |
\sa version
|
|
744 |
*/
|
|
745 |
QStyleOptionFrameV3::QStyleOptionFrameV3(const QStyleOptionFrame &other)
|
|
746 |
{
|
|
747 |
operator=(other);
|
|
748 |
}
|
|
749 |
|
|
750 |
/*!
|
|
751 |
Assigns the \a other style option to this style option. The \a
|
|
752 |
other style option can be either of the QStyleOptionFrameV3,
|
|
753 |
QStyleOptionFrameV2 or QStyleOptionFrame types.
|
|
754 |
|
|
755 |
If the \a other style option's version is 1, the new style
|
|
756 |
option's \l FrameFeature value is set to
|
|
757 |
\l{QStyleOptionFrameV2::None}. If its version is 2 or lower,
|
|
758 |
\l{QStyleOptionFrameV3::frameShape} value is QFrame::NoFrame
|
|
759 |
*/
|
|
760 |
QStyleOptionFrameV3 &QStyleOptionFrameV3::operator=(const QStyleOptionFrame &other)
|
|
761 |
{
|
|
762 |
QStyleOptionFrameV2::operator=(other);
|
|
763 |
|
|
764 |
const QStyleOptionFrameV3 *f3 = qstyleoption_cast<const QStyleOptionFrameV3 *>(&other);
|
|
765 |
frameShape = f3 ? f3->frameShape : QFrame::NoFrame;
|
|
766 |
version = Version;
|
|
767 |
return *this;
|
|
768 |
}
|
|
769 |
|
|
770 |
|
|
771 |
/*!
|
|
772 |
\variable QStyleOptionFrameV3::frameShape
|
|
773 |
\brief This property holds the frame shape value of the frame.
|
|
774 |
|
|
775 |
\sa QFrame::frameShape
|
|
776 |
*/
|
|
777 |
|
|
778 |
/*!
|
|
779 |
\enum QStyleOptionFrameV3::StyleOptionVersion
|
|
780 |
|
|
781 |
This enum is used to hold information about the version of the style option, and
|
|
782 |
is defined for each QStyleOption subclass.
|
|
783 |
|
|
784 |
\value Version 3
|
|
785 |
|
|
786 |
The version is used by QStyleOption subclasses to implement
|
|
787 |
extensions without breaking compatibility. If you use
|
|
788 |
qstyleoption_cast(), you normally do not need to check it.
|
|
789 |
|
|
790 |
\sa StyleOptionType
|
|
791 |
*/
|
|
792 |
|
|
793 |
/*!
|
|
794 |
\class QStyleOptionViewItemV2
|
|
795 |
\brief The QStyleOptionViewItemV2 class is used to describe the
|
|
796 |
parameters necessary for drawing a frame in Qt 4.2 or above.
|
|
797 |
\since 4.2
|
|
798 |
|
|
799 |
QStyleOptionViewItemV2 inherits QStyleOptionViewItem.
|
|
800 |
|
|
801 |
An instance of the QStyleOptionViewItemV2 class has
|
|
802 |
\l{QStyleOption::type} {type} SO_ViewItem and
|
|
803 |
\l{QStyleOption::version} {version} 2. The type is used internally
|
|
804 |
by QStyleOption, its subclasses, and qstyleoption_cast() to
|
|
805 |
determine the type of style option. In general you do not need to
|
|
806 |
worry about this unless you want to create your own QStyleOption
|
|
807 |
subclass and your own styles. The version is used by QStyleOption
|
|
808 |
subclasses to implement extensions without breaking
|
|
809 |
compatibility. If you use qstyleoption_cast(), you normally do not
|
|
810 |
need to check it.
|
|
811 |
|
|
812 |
See QStyleOptionFrameV2's detailed description for a discussion
|
|
813 |
of how to handle "V2" classes.
|
|
814 |
|
|
815 |
\sa QStyleOptionViewItem, QStyleOption
|
|
816 |
*/
|
|
817 |
|
|
818 |
/*!
|
|
819 |
\enum QStyleOptionViewItemV2::StyleOptionVersion
|
|
820 |
|
|
821 |
This enum is used to hold information about the version of the
|
|
822 |
style option, and is defined for each QStyleOption subclass.
|
|
823 |
|
|
824 |
\value Version 2
|
|
825 |
|
|
826 |
The version is used by QStyleOption subclasses to implement
|
|
827 |
extensions without breaking compatibility. If you use
|
|
828 |
qstyleoption_cast(), you normally do not need to check it.
|
|
829 |
|
|
830 |
\sa StyleOptionType
|
|
831 |
*/
|
|
832 |
|
|
833 |
/*!
|
|
834 |
\variable QStyleOptionViewItemV2::features
|
|
835 |
\brief a bitwise OR of the features that describe this view item
|
|
836 |
|
|
837 |
\sa ViewItemFeature
|
|
838 |
*/
|
|
839 |
|
|
840 |
/*!
|
|
841 |
Constructs a QStyleOptionViewItemV2 object.
|
|
842 |
*/
|
|
843 |
QStyleOptionViewItemV2::QStyleOptionViewItemV2()
|
|
844 |
: QStyleOptionViewItem(Version), features(None)
|
|
845 |
{
|
|
846 |
}
|
|
847 |
|
|
848 |
/*!
|
|
849 |
\fn QStyleOptionViewItemV2::QStyleOptionViewItemV2(const QStyleOptionViewItemV2 &other)
|
|
850 |
|
|
851 |
Constructs a copy of \a other.
|
|
852 |
*/
|
|
853 |
|
|
854 |
/*!
|
|
855 |
Constructs a QStyleOptionViewItemV2 copy of the \a other style option
|
|
856 |
which can be either of the QStyleOptionViewItemV2 or
|
|
857 |
QStyleOptionViewItem types.
|
|
858 |
|
|
859 |
If the \a other style option's version is 1, the new style option's \l
|
|
860 |
ViewItemFeature value is set to \l QStyleOptionViewItemV2::None. If its
|
|
861 |
version is 2, its \l ViewItemFeature value is simply copied to the
|
|
862 |
new style option.
|
|
863 |
|
|
864 |
\sa version
|
|
865 |
*/
|
|
866 |
QStyleOptionViewItemV2::QStyleOptionViewItemV2(const QStyleOptionViewItem &other)
|
|
867 |
: QStyleOptionViewItem(Version)
|
|
868 |
{
|
|
869 |
(void)QStyleOptionViewItemV2::operator=(other);
|
|
870 |
}
|
|
871 |
|
|
872 |
/*!
|
|
873 |
\internal
|
|
874 |
*/
|
|
875 |
QStyleOptionViewItemV2::QStyleOptionViewItemV2(int version)
|
|
876 |
: QStyleOptionViewItem(version)
|
|
877 |
{
|
|
878 |
|
|
879 |
}
|
|
880 |
|
|
881 |
/*!
|
|
882 |
Assigns the \a other style option to this style option. The \a
|
|
883 |
other style option can be either of the QStyleOptionViewItemV2 or
|
|
884 |
QStyleOptionViewItem types.
|
|
885 |
|
|
886 |
If the \a{other} style option's version is 1, this style option's
|
|
887 |
\l ViewItemFeature value is set to \l QStyleOptionViewItemV2::None.
|
|
888 |
If its version is 2, its \l ViewItemFeature value is simply copied
|
|
889 |
to this style option.
|
|
890 |
*/
|
|
891 |
QStyleOptionViewItemV2 &QStyleOptionViewItemV2::operator=(const QStyleOptionViewItem &other)
|
|
892 |
{
|
|
893 |
QStyleOptionViewItem::operator=(other);
|
|
894 |
const QStyleOptionViewItemV2 *v2 = qstyleoption_cast<const QStyleOptionViewItemV2 *>(&other);
|
|
895 |
features = v2 ? v2->features : ViewItemFeatures(QStyleOptionViewItemV2::None);
|
|
896 |
return *this;
|
|
897 |
}
|
|
898 |
|
|
899 |
/*!
|
|
900 |
\enum QStyleOptionViewItemV2::ViewItemFeature
|
|
901 |
|
|
902 |
This enum describes the different types of features an item can have.
|
|
903 |
|
|
904 |
\value None Indicates a normal item.
|
|
905 |
\value WrapText Indicates an item with wrapped text.
|
|
906 |
\value Alternate Indicates that the item's background is rendered using alternateBase.
|
|
907 |
\value HasCheckIndicator Indicates that the item has a check state indicator.
|
|
908 |
\value HasDisplay Indicates that the item has a display role.
|
|
909 |
\value HasDecoration Indicates that the item has a decoration role.
|
|
910 |
*/
|
|
911 |
|
|
912 |
|
|
913 |
|
|
914 |
/*!
|
|
915 |
\class QStyleOptionViewItemV3
|
|
916 |
\brief The QStyleOptionViewItemV3 class is used to describe the
|
|
917 |
parameters necessary for drawing a frame in Qt 4.3 or above.
|
|
918 |
\since 4.3
|
|
919 |
|
|
920 |
QStyleOptionViewItemV3 inherits QStyleOptionViewItem.
|
|
921 |
|
|
922 |
An instance of the QStyleOptionViewItemV3 class has
|
|
923 |
\l{QStyleOption::type} {type} SO_ViewItem and \l{QStyleOption::version}
|
|
924 |
{version} 3. The type is used internally by QStyleOption, its subclasses,
|
|
925 |
and qstyleoption_cast() to determine the type of style option. In general
|
|
926 |
you do not need to worry about this unless you want to create your own
|
|
927 |
QStyleOption subclass and your own styles. The version is used by
|
|
928 |
QStyleOption subclasses to implement extensions without breaking
|
|
929 |
compatibility. If you use qstyleoption_cast(), you normally do not need to
|
|
930 |
check it.
|
|
931 |
|
|
932 |
See QStyleOptionFrameV2's detailed description for a discussion
|
|
933 |
of how to handle "V2" and other versioned classes.
|
|
934 |
|
|
935 |
\sa QStyleOptionViewItem, QStyleOption
|
|
936 |
*/
|
|
937 |
|
|
938 |
/*!
|
|
939 |
\enum QStyleOptionViewItemV3::StyleOptionVersion
|
|
940 |
|
|
941 |
This enum is used to hold information about the version of the
|
|
942 |
style option, and is defined for each QStyleOption subclass.
|
|
943 |
|
|
944 |
\value Version 3
|
|
945 |
|
|
946 |
The version is used by QStyleOption subclasses to implement
|
|
947 |
extensions without breaking compatibility. If you use
|
|
948 |
qstyleoption_cast(), you normally do not need to check it.
|
|
949 |
|
|
950 |
\sa StyleOptionType
|
|
951 |
*/
|
|
952 |
|
|
953 |
/*!
|
|
954 |
Constructs a QStyleOptionViewItemV3 object.
|
|
955 |
*/
|
|
956 |
QStyleOptionViewItemV3::QStyleOptionViewItemV3()
|
|
957 |
: QStyleOptionViewItemV2(Version), widget(0)
|
|
958 |
{
|
|
959 |
}
|
|
960 |
|
|
961 |
/*!
|
|
962 |
Constructs a copy of \a other.
|
|
963 |
*/
|
|
964 |
QStyleOptionViewItemV3::QStyleOptionViewItemV3(const QStyleOptionViewItem &other)
|
|
965 |
: QStyleOptionViewItemV2(Version), widget(0)
|
|
966 |
{
|
|
967 |
(void)QStyleOptionViewItemV3::operator=(other);
|
|
968 |
}
|
|
969 |
|
|
970 |
/*!
|
|
971 |
\fn QStyleOptionViewItemV3::QStyleOptionViewItemV3(const QStyleOptionViewItemV3 &other)
|
|
972 |
|
|
973 |
Constructs a copy of \a other.
|
|
974 |
*/
|
|
975 |
|
|
976 |
/*!
|
|
977 |
Assigns the \a other style option to this style option. The \a
|
|
978 |
other style option can be an instance of the QStyleOptionViewItemV2,
|
|
979 |
QStyleOptionViewItemV3 or QStyleOptionViewItem types.
|
|
980 |
*/
|
|
981 |
QStyleOptionViewItemV3 &QStyleOptionViewItemV3::operator = (const QStyleOptionViewItem &other)
|
|
982 |
{
|
|
983 |
QStyleOptionViewItemV2::operator=(other);
|
|
984 |
const QStyleOptionViewItemV3 *v3 = qstyleoption_cast<const QStyleOptionViewItemV3*>(&other);
|
|
985 |
locale = v3 ? v3->locale : QLocale();
|
|
986 |
widget = v3 ? v3->widget : 0;
|
|
987 |
return *this;
|
|
988 |
}
|
|
989 |
|
|
990 |
/*!
|
|
991 |
\internal
|
|
992 |
*/
|
|
993 |
QStyleOptionViewItemV3::QStyleOptionViewItemV3(int version)
|
|
994 |
: QStyleOptionViewItemV2(version), widget(0)
|
|
995 |
{
|
|
996 |
}
|
|
997 |
|
|
998 |
#ifndef QT_NO_ITEMVIEWS
|
|
999 |
|
|
1000 |
/*!
|
|
1001 |
\class QStyleOptionViewItemV4
|
|
1002 |
\brief The QStyleOptionViewItemV4 class is used to describe the
|
|
1003 |
parameters necessary for drawing a frame in Qt 4.4 or above.
|
|
1004 |
\since 4.4
|
|
1005 |
|
|
1006 |
QStyleOptionViewItemV4 inherits QStyleOptionViewItemV3.
|
|
1007 |
|
|
1008 |
An instance of the QStyleOptionViewItemV4 class has
|
|
1009 |
\l{QStyleOption::type} {type} SO_ViewItem and
|
|
1010 |
\l{QStyleOption::version} {version} 4. The type is used internally
|
|
1011 |
by QStyleOption, its subclasses, and qstyleoption_cast() to
|
|
1012 |
determine the type of style option. In general you do not need to
|
|
1013 |
worry about this unless you want to create your own QStyleOption
|
|
1014 |
subclass and your own styles. The version is used by QStyleOption
|
|
1015 |
subclasses to implement extensions without breaking
|
|
1016 |
compatibility. If you use qstyleoption_cast(), you normally do not
|
|
1017 |
need to check it.
|
|
1018 |
|
|
1019 |
See QStyleOptionViewItemV3's detailed description for a discussion
|
|
1020 |
of how to handle "V3" classes.
|
|
1021 |
|
|
1022 |
\sa QStyleOptionViewItem, QStyleOption
|
|
1023 |
*/
|
|
1024 |
|
|
1025 |
/*!
|
|
1026 |
\variable QStyleOptionViewItemV4::index
|
|
1027 |
|
|
1028 |
The model index that is to be drawn.
|
|
1029 |
*/
|
|
1030 |
|
|
1031 |
/*!
|
|
1032 |
\variable QStyleOptionViewItemV4::checkState
|
|
1033 |
|
|
1034 |
If this view item is checkable, i.e.,
|
|
1035 |
ViewItemFeature::HasCheckIndicator is true, \c checkState is true
|
|
1036 |
if the item is checked; otherwise, it is false.
|
|
1037 |
|
|
1038 |
*/
|
|
1039 |
|
|
1040 |
/*!
|
|
1041 |
\variable QStyleOptionViewItemV4::icon
|
|
1042 |
|
|
1043 |
The icon (if any) to be drawn in the view item.
|
|
1044 |
*/
|
|
1045 |
|
|
1046 |
|
|
1047 |
/*!
|
|
1048 |
\variable QStyleOptionViewItemV4::text
|
|
1049 |
|
|
1050 |
The text (if any) to be drawn in the view item.
|
|
1051 |
*/
|
|
1052 |
|
|
1053 |
/*!
|
|
1054 |
\variable QStyleOptionViewItemV4::backgroundBrush
|
|
1055 |
|
|
1056 |
The QBrush that should be used to paint the view items
|
|
1057 |
background.
|
|
1058 |
*/
|
|
1059 |
|
|
1060 |
/*!
|
|
1061 |
\variable QStyleOptionViewItemV4::viewItemPosition
|
|
1062 |
|
|
1063 |
Gives the position of this view item relative to other items. See
|
|
1064 |
the \l{QStyleOptionViewItemV4::}{ViewItemPosition} enum for the
|
|
1065 |
details.
|
|
1066 |
*/
|
|
1067 |
|
|
1068 |
/*!
|
|
1069 |
\enum QStyleOptionViewItemV4::StyleOptionVersion
|
|
1070 |
|
|
1071 |
This enum is used to hold information about the version of the
|
|
1072 |
style option, and is defined for each QStyleOption subclass.
|
|
1073 |
|
|
1074 |
\value Version 4
|
|
1075 |
|
|
1076 |
The version is used by QStyleOption subclasses to implement
|
|
1077 |
extensions without breaking compatibility. If you use
|
|
1078 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1079 |
|
|
1080 |
\sa StyleOptionType
|
|
1081 |
*/
|
|
1082 |
|
|
1083 |
/*!
|
|
1084 |
\enum QStyleOptionViewItemV4::ViewItemPosition
|
|
1085 |
|
|
1086 |
This enum is used to represent the placement of the item on
|
|
1087 |
a row. This can be used to draw items differently depending
|
|
1088 |
on their placement, for example by putting rounded edges at
|
|
1089 |
the beginning and end, and straight edges in between.
|
|
1090 |
|
|
1091 |
\value Invalid The ViewItemPosition is unknown and should be
|
|
1092 |
disregarded.
|
|
1093 |
\value Beginning The item appears at the beginning of the row.
|
|
1094 |
\value Middle The item appears in the middle of the row.
|
|
1095 |
\value End The item appears at the end of the row.
|
|
1096 |
\value OnlyOne The item is the only one on the row, and is
|
|
1097 |
therefore both at the beginning and the end.
|
|
1098 |
*/
|
|
1099 |
|
|
1100 |
|
|
1101 |
/*!
|
|
1102 |
Constructs a QStyleOptionViewItemV4 object.
|
|
1103 |
*/
|
|
1104 |
QStyleOptionViewItemV4::QStyleOptionViewItemV4()
|
|
1105 |
: QStyleOptionViewItemV3(Version), checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItemV4::Invalid)
|
|
1106 |
{
|
|
1107 |
}
|
|
1108 |
|
|
1109 |
/*!
|
|
1110 |
\fn QStyleOptionViewItemV4::QStyleOptionViewItemV4(const QStyleOptionViewItemV4 &other)
|
|
1111 |
|
|
1112 |
Constructs a copy of \a other.
|
|
1113 |
*/
|
|
1114 |
|
|
1115 |
/*!
|
|
1116 |
Constructs a QStyleOptionViewItemV4 copy of the \a other style option
|
|
1117 |
which can be either of the QStyleOptionViewItemV3 or
|
|
1118 |
QStyleOptionViewItem types.
|
|
1119 |
|
|
1120 |
\sa version
|
|
1121 |
*/
|
|
1122 |
QStyleOptionViewItemV4::QStyleOptionViewItemV4(const QStyleOptionViewItem &other)
|
|
1123 |
: QStyleOptionViewItemV3(Version)
|
|
1124 |
{
|
|
1125 |
(void)QStyleOptionViewItemV4::operator=(other);
|
|
1126 |
}
|
|
1127 |
|
|
1128 |
/*!
|
|
1129 |
Assigns the \a other style option to this style option. The \a
|
|
1130 |
other style option can be either of the QStyleOptionViewItemV3 or
|
|
1131 |
QStyleOptionViewItem types.
|
|
1132 |
*/
|
|
1133 |
QStyleOptionViewItemV4 &QStyleOptionViewItemV4::operator = (const QStyleOptionViewItem &other)
|
|
1134 |
{
|
|
1135 |
QStyleOptionViewItemV3::operator=(other);
|
|
1136 |
if (const QStyleOptionViewItemV4 *v4 = qstyleoption_cast<const QStyleOptionViewItemV4*>(&other)) {
|
|
1137 |
index = v4->index;
|
|
1138 |
checkState = v4->checkState;
|
|
1139 |
text = v4->text;
|
|
1140 |
viewItemPosition = v4->viewItemPosition;
|
|
1141 |
backgroundBrush = v4->backgroundBrush;
|
|
1142 |
icon = v4->icon;
|
|
1143 |
} else {
|
|
1144 |
viewItemPosition = QStyleOptionViewItemV4::Invalid;
|
|
1145 |
checkState = Qt::Unchecked;
|
|
1146 |
}
|
|
1147 |
return *this;
|
|
1148 |
}
|
|
1149 |
|
|
1150 |
/*!
|
|
1151 |
\internal
|
|
1152 |
*/
|
|
1153 |
QStyleOptionViewItemV4::QStyleOptionViewItemV4(int version)
|
|
1154 |
: QStyleOptionViewItemV3(version)
|
|
1155 |
{
|
|
1156 |
}
|
|
1157 |
#endif // QT_NO_ITEMVIEWS
|
|
1158 |
|
|
1159 |
/*!
|
|
1160 |
\class QStyleOptionGroupBox
|
|
1161 |
\brief The QStyleOptionGroupBox class describes the parameters for
|
|
1162 |
drawing a group box.
|
|
1163 |
|
|
1164 |
\since 4.1
|
|
1165 |
|
|
1166 |
QStyleOptionButton contains all the information that QStyle
|
|
1167 |
functions need the various graphical elements of a group box.
|
|
1168 |
|
|
1169 |
It holds the lineWidth and the midLineWidth for drawing the panel,
|
|
1170 |
the group box's \l {text}{title} and the title's \l
|
|
1171 |
{textAlignment}{alignment} and \l {textColor}{color}.
|
|
1172 |
|
|
1173 |
For performance reasons, the access to the member variables is
|
|
1174 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
1175 |
makes the structures straightforward to use and emphasizes that
|
|
1176 |
these are simply parameters used by the style functions.
|
|
1177 |
|
|
1178 |
For an example demonstrating how style options can be used, see
|
|
1179 |
the \l {widgets/styles}{Styles} example.
|
|
1180 |
|
|
1181 |
\sa QStyleOption, QStyleOptionComplex, QGroupBox
|
|
1182 |
*/
|
|
1183 |
|
|
1184 |
/*!
|
|
1185 |
\enum QStyleOptionGroupBox::StyleOptionType
|
|
1186 |
|
|
1187 |
This enum is used to hold information about the type of the style option, and
|
|
1188 |
is defined for each QStyleOption subclass.
|
|
1189 |
|
|
1190 |
\value Type The type of style option provided (\l{SO_GroupBox} for this class).
|
|
1191 |
|
|
1192 |
The type is used internally by QStyleOption, its subclasses, and
|
|
1193 |
qstyleoption_cast() to determine the type of style option. In
|
|
1194 |
general you do not need to worry about this unless you want to
|
|
1195 |
create your own QStyleOption subclass and your own styles.
|
|
1196 |
|
|
1197 |
\sa StyleOptionVersion
|
|
1198 |
*/
|
|
1199 |
|
|
1200 |
/*!
|
|
1201 |
\enum QStyleOptionGroupBox::StyleOptionVersion
|
|
1202 |
|
|
1203 |
This enum is used to hold information about the version of the style option, and
|
|
1204 |
is defined for each QStyleOption subclass.
|
|
1205 |
|
|
1206 |
\value Version 1
|
|
1207 |
|
|
1208 |
The version is used by QStyleOption subclasses to implement
|
|
1209 |
extensions without breaking compatibility. If you use
|
|
1210 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1211 |
|
|
1212 |
\sa StyleOptionType
|
|
1213 |
*/
|
|
1214 |
|
|
1215 |
/*!
|
|
1216 |
\variable QStyleOptionGroupBox::lineWidth
|
|
1217 |
\brief the line width for drawing the panel
|
|
1218 |
|
|
1219 |
The value of this variable is, currently, always 1.
|
|
1220 |
|
|
1221 |
\sa QFrame::lineWidth
|
|
1222 |
*/
|
|
1223 |
|
|
1224 |
/*!
|
|
1225 |
\variable QStyleOptionGroupBox::midLineWidth
|
|
1226 |
\brief the mid-line width for drawing the panel
|
|
1227 |
|
|
1228 |
The mid-line width is usually used when drawing sunken or raised
|
|
1229 |
group box frames. The value of this variable is, currently, always 0.
|
|
1230 |
|
|
1231 |
\sa QFrame::midLineWidth
|
|
1232 |
*/
|
|
1233 |
|
|
1234 |
/*!
|
|
1235 |
\variable QStyleOptionGroupBox::text
|
|
1236 |
\brief the text of the group box
|
|
1237 |
|
|
1238 |
The default value is an empty string.
|
|
1239 |
|
|
1240 |
\sa QGroupBox::title
|
|
1241 |
*/
|
|
1242 |
|
|
1243 |
/*!
|
|
1244 |
\variable QStyleOptionGroupBox::textAlignment
|
|
1245 |
\brief the alignment of the group box title
|
|
1246 |
|
|
1247 |
The default value is Qt::AlignLeft.
|
|
1248 |
|
|
1249 |
\sa QGroupBox::alignment
|
|
1250 |
*/
|
|
1251 |
|
|
1252 |
/*!
|
|
1253 |
\variable QStyleOptionGroupBox::features
|
|
1254 |
\brief the features of the group box frame
|
|
1255 |
|
|
1256 |
The frame is flat by default.
|
|
1257 |
|
|
1258 |
\sa QStyleOptionFrameV2::FrameFeature
|
|
1259 |
*/
|
|
1260 |
|
|
1261 |
/*!
|
|
1262 |
\variable QStyleOptionGroupBox::textColor
|
|
1263 |
\brief the color of the group box title
|
|
1264 |
|
|
1265 |
The default value is an invalid color with the RGB value (0, 0,
|
|
1266 |
0). An invalid color is a color that is not properly set up for
|
|
1267 |
the underlying window system.
|
|
1268 |
*/
|
|
1269 |
|
|
1270 |
/*!
|
|
1271 |
Constructs a QStyleOptionGroupBox, initializing the members
|
|
1272 |
variables to their default values.
|
|
1273 |
*/
|
|
1274 |
QStyleOptionGroupBox::QStyleOptionGroupBox()
|
|
1275 |
: QStyleOptionComplex(Version, Type), features(QStyleOptionFrameV2::None),
|
|
1276 |
textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0)
|
|
1277 |
{
|
|
1278 |
}
|
|
1279 |
|
|
1280 |
/*!
|
|
1281 |
\fn QStyleOptionGroupBox::QStyleOptionGroupBox(const QStyleOptionGroupBox &other)
|
|
1282 |
|
|
1283 |
Constructs a copy of the \a other style option.
|
|
1284 |
*/
|
|
1285 |
|
|
1286 |
/*!
|
|
1287 |
\internal
|
|
1288 |
*/
|
|
1289 |
QStyleOptionGroupBox::QStyleOptionGroupBox(int version)
|
|
1290 |
: QStyleOptionComplex(version, Type), features(QStyleOptionFrameV2::None),
|
|
1291 |
textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0)
|
|
1292 |
{
|
|
1293 |
}
|
|
1294 |
|
|
1295 |
/*!
|
|
1296 |
\class QStyleOptionHeader
|
|
1297 |
\brief The QStyleOptionHeader class is used to describe the
|
|
1298 |
parameters for drawing a header.
|
|
1299 |
|
|
1300 |
QStyleOptionHeader contains all the information that QStyle
|
|
1301 |
functions need to draw the item views' header pane, header sort
|
|
1302 |
arrow, and header label.
|
|
1303 |
|
|
1304 |
For performance reasons, the access to the member variables is
|
|
1305 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
1306 |
makes the structures straightforward to use and emphasizes that
|
|
1307 |
these are simply parameters used by the style functions.
|
|
1308 |
|
|
1309 |
For an example demonstrating how style options can be used, see
|
|
1310 |
the \l {widgets/styles}{Styles} example.
|
|
1311 |
|
|
1312 |
\sa QStyleOption
|
|
1313 |
*/
|
|
1314 |
|
|
1315 |
/*!
|
|
1316 |
Constructs a QStyleOptionHeader, initializing the members
|
|
1317 |
variables to their default values.
|
|
1318 |
*/
|
|
1319 |
|
|
1320 |
QStyleOptionHeader::QStyleOptionHeader()
|
|
1321 |
: QStyleOption(QStyleOptionHeader::Version, SO_Header),
|
|
1322 |
section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft),
|
|
1323 |
position(QStyleOptionHeader::Beginning),
|
|
1324 |
selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
|
|
1325 |
orientation(Qt::Horizontal)
|
|
1326 |
{
|
|
1327 |
}
|
|
1328 |
|
|
1329 |
/*!
|
|
1330 |
\internal
|
|
1331 |
*/
|
|
1332 |
QStyleOptionHeader::QStyleOptionHeader(int version)
|
|
1333 |
: QStyleOption(version, SO_Header),
|
|
1334 |
section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft),
|
|
1335 |
position(QStyleOptionHeader::Beginning),
|
|
1336 |
selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
|
|
1337 |
orientation(Qt::Horizontal)
|
|
1338 |
{
|
|
1339 |
}
|
|
1340 |
|
|
1341 |
/*!
|
|
1342 |
\variable QStyleOptionHeader::orientation
|
|
1343 |
\brief the header's orientation (horizontal or vertical)
|
|
1344 |
|
|
1345 |
The default orientation is Qt::Horizontal
|
|
1346 |
*/
|
|
1347 |
|
|
1348 |
/*!
|
|
1349 |
\fn QStyleOptionHeader::QStyleOptionHeader(const QStyleOptionHeader &other)
|
|
1350 |
|
|
1351 |
Constructs a copy of the \a other style option.
|
|
1352 |
*/
|
|
1353 |
|
|
1354 |
/*!
|
|
1355 |
\enum QStyleOptionHeader::StyleOptionType
|
|
1356 |
|
|
1357 |
This enum is used to hold information about the type of the style option, and
|
|
1358 |
is defined for each QStyleOption subclass.
|
|
1359 |
|
|
1360 |
\value Type The type of style option provided (\l{SO_Header} for this class).
|
|
1361 |
|
|
1362 |
The type is used internally by QStyleOption, its subclasses, and
|
|
1363 |
qstyleoption_cast() to determine the type of style option. In
|
|
1364 |
general you do not need to worry about this unless you want to
|
|
1365 |
create your own QStyleOption subclass and your own styles.
|
|
1366 |
|
|
1367 |
\sa StyleOptionVersion
|
|
1368 |
*/
|
|
1369 |
|
|
1370 |
/*!
|
|
1371 |
\enum QStyleOptionHeader::StyleOptionVersion
|
|
1372 |
|
|
1373 |
This enum is used to hold information about the version of the style option, and
|
|
1374 |
is defined for each QStyleOption subclass.
|
|
1375 |
|
|
1376 |
\value Version 1
|
|
1377 |
|
|
1378 |
The version is used by QStyleOption subclasses to implement
|
|
1379 |
extensions without breaking compatibility. If you use
|
|
1380 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1381 |
|
|
1382 |
\sa StyleOptionType
|
|
1383 |
*/
|
|
1384 |
|
|
1385 |
/*!
|
|
1386 |
\variable QStyleOptionHeader::section
|
|
1387 |
\brief which section of the header is being painted
|
|
1388 |
|
|
1389 |
The default value is 0.
|
|
1390 |
*/
|
|
1391 |
|
|
1392 |
/*!
|
|
1393 |
\variable QStyleOptionHeader::text
|
|
1394 |
\brief the text of the header
|
|
1395 |
|
|
1396 |
The default value is an empty string.
|
|
1397 |
*/
|
|
1398 |
|
|
1399 |
/*!
|
|
1400 |
\variable QStyleOptionHeader::textAlignment
|
|
1401 |
\brief the alignment flags for the text of the header
|
|
1402 |
|
|
1403 |
The default value is Qt::AlignLeft.
|
|
1404 |
*/
|
|
1405 |
|
|
1406 |
/*!
|
|
1407 |
\variable QStyleOptionHeader::icon
|
|
1408 |
\brief the icon of the header
|
|
1409 |
|
|
1410 |
The default value is an empty icon, i.e. an icon with neither a
|
|
1411 |
pixmap nor a filename.
|
|
1412 |
*/
|
|
1413 |
|
|
1414 |
/*!
|
|
1415 |
\variable QStyleOptionHeader::iconAlignment
|
|
1416 |
\brief the alignment flags for the icon of the header
|
|
1417 |
|
|
1418 |
The default value is Qt::AlignLeft.
|
|
1419 |
*/
|
|
1420 |
|
|
1421 |
/*!
|
|
1422 |
\variable QStyleOptionHeader::position
|
|
1423 |
\brief the section's position in relation to the other sections
|
|
1424 |
|
|
1425 |
The default value is QStyleOptionHeader::Beginning.
|
|
1426 |
*/
|
|
1427 |
|
|
1428 |
/*!
|
|
1429 |
\variable QStyleOptionHeader::selectedPosition
|
|
1430 |
\brief the section's position in relation to the selected section
|
|
1431 |
|
|
1432 |
The default value is QStyleOptionHeader::NotAdjacent
|
|
1433 |
*/
|
|
1434 |
|
|
1435 |
/*!
|
|
1436 |
\variable QStyleOptionHeader::sortIndicator
|
|
1437 |
\brief the direction the sort indicator should be drawn
|
|
1438 |
|
|
1439 |
The default value is QStyleOptionHeader::None.
|
|
1440 |
*/
|
|
1441 |
|
|
1442 |
/*!
|
|
1443 |
\enum QStyleOptionHeader::SectionPosition
|
|
1444 |
|
|
1445 |
This enum lets you know where the section's position is in relation to the other sections.
|
|
1446 |
|
|
1447 |
\value Beginning At the beginining of the header
|
|
1448 |
\value Middle In the middle of the header
|
|
1449 |
\value End At the end of the header
|
|
1450 |
\value OnlyOneSection Only one header section
|
|
1451 |
|
|
1452 |
\sa position
|
|
1453 |
*/
|
|
1454 |
|
|
1455 |
/*!
|
|
1456 |
\enum QStyleOptionHeader::SelectedPosition
|
|
1457 |
|
|
1458 |
This enum lets you know where the section's position is in relation to the selected section.
|
|
1459 |
|
|
1460 |
\value NotAdjacent Not adjacent to the selected section
|
|
1461 |
\value NextIsSelected The next section is selected
|
|
1462 |
\value PreviousIsSelected The previous section is selected
|
|
1463 |
\value NextAndPreviousAreSelected Both the next and previous section are selected
|
|
1464 |
|
|
1465 |
\sa selectedPosition
|
|
1466 |
*/
|
|
1467 |
|
|
1468 |
/*!
|
|
1469 |
\enum QStyleOptionHeader::SortIndicator
|
|
1470 |
|
|
1471 |
Indicates which direction the sort indicator should be drawn
|
|
1472 |
|
|
1473 |
\value None No sort indicator is needed
|
|
1474 |
\value SortUp Draw an up indicator
|
|
1475 |
\value SortDown Draw a down indicator
|
|
1476 |
|
|
1477 |
\sa sortIndicator
|
|
1478 |
*/
|
|
1479 |
|
|
1480 |
/*!
|
|
1481 |
\class QStyleOptionButton
|
|
1482 |
\brief The QStyleOptionButton class is used to describe the
|
|
1483 |
parameters for drawing buttons.
|
|
1484 |
|
|
1485 |
QStyleOptionButton contains all the information that QStyle
|
|
1486 |
functions need to draw graphical elements like QPushButton,
|
|
1487 |
QCheckBox, and QRadioButton.
|
|
1488 |
|
|
1489 |
For performance reasons, the access to the member variables is
|
|
1490 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
1491 |
makes the structures straightforward to use and emphasizes that
|
|
1492 |
these are simply parameters used by the style functions.
|
|
1493 |
|
|
1494 |
For an example demonstrating how style options can be used, see
|
|
1495 |
the \l {widgets/styles}{Styles} example.
|
|
1496 |
|
|
1497 |
\sa QStyleOption, QStyleOptionToolButton
|
|
1498 |
*/
|
|
1499 |
|
|
1500 |
/*!
|
|
1501 |
\enum QStyleOptionButton::ButtonFeature
|
|
1502 |
|
|
1503 |
This enum describes the different types of features a push button can have.
|
|
1504 |
|
|
1505 |
\value None Indicates a normal push button.
|
|
1506 |
\value Flat Indicates a flat push button.
|
|
1507 |
\value HasMenu Indicates that the button has a drop down menu.
|
|
1508 |
\value DefaultButton Indicates that the button is a default button.
|
|
1509 |
\value AutoDefaultButton Indicates that the button is an auto default button.
|
|
1510 |
\value CommandLinkButton Indicates that the button is a Windows Vista type command link.
|
|
1511 |
|
|
1512 |
\sa features
|
|
1513 |
*/
|
|
1514 |
|
|
1515 |
/*!
|
|
1516 |
Constructs a QStyleOptionButton, initializing the members
|
|
1517 |
variables to their default values.
|
|
1518 |
*/
|
|
1519 |
|
|
1520 |
QStyleOptionButton::QStyleOptionButton()
|
|
1521 |
: QStyleOption(QStyleOptionButton::Version, SO_Button), features(None)
|
|
1522 |
{
|
|
1523 |
}
|
|
1524 |
|
|
1525 |
/*!
|
|
1526 |
\internal
|
|
1527 |
*/
|
|
1528 |
QStyleOptionButton::QStyleOptionButton(int version)
|
|
1529 |
: QStyleOption(version, SO_Button), features(None)
|
|
1530 |
{
|
|
1531 |
}
|
|
1532 |
|
|
1533 |
/*!
|
|
1534 |
\fn QStyleOptionButton::QStyleOptionButton(const QStyleOptionButton &other)
|
|
1535 |
|
|
1536 |
Constructs a copy of the \a other style option.
|
|
1537 |
*/
|
|
1538 |
|
|
1539 |
/*!
|
|
1540 |
\enum QStyleOptionButton::StyleOptionType
|
|
1541 |
|
|
1542 |
This enum is used to hold information about the type of the style option, and
|
|
1543 |
is defined for each QStyleOption subclass.
|
|
1544 |
|
|
1545 |
\value Type The type of style option provided (\l{SO_Button} for this class).
|
|
1546 |
|
|
1547 |
The type is used internally by QStyleOption, its subclasses, and
|
|
1548 |
qstyleoption_cast() to determine the type of style option. In
|
|
1549 |
general you do not need to worry about this unless you want to
|
|
1550 |
create your own QStyleOption subclass and your own styles.
|
|
1551 |
|
|
1552 |
\sa StyleOptionVersion
|
|
1553 |
*/
|
|
1554 |
|
|
1555 |
/*!
|
|
1556 |
\enum QStyleOptionButton::StyleOptionVersion
|
|
1557 |
|
|
1558 |
This enum is used to hold information about the version of the style option, and
|
|
1559 |
is defined for each QStyleOption subclass.
|
|
1560 |
|
|
1561 |
\value Version 1
|
|
1562 |
|
|
1563 |
The version is used by QStyleOption subclasses to implement
|
|
1564 |
extensions without breaking compatibility. If you use
|
|
1565 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1566 |
|
|
1567 |
\sa StyleOptionType
|
|
1568 |
*/
|
|
1569 |
|
|
1570 |
/*!
|
|
1571 |
\variable QStyleOptionButton::features
|
|
1572 |
\brief a bitwise OR of the features that describe this button
|
|
1573 |
|
|
1574 |
\sa ButtonFeature
|
|
1575 |
*/
|
|
1576 |
|
|
1577 |
/*!
|
|
1578 |
\variable QStyleOptionButton::text
|
|
1579 |
\brief the text of the button
|
|
1580 |
|
|
1581 |
The default value is an empty string.
|
|
1582 |
*/
|
|
1583 |
|
|
1584 |
/*!
|
|
1585 |
\variable QStyleOptionButton::icon
|
|
1586 |
\brief the icon of the button
|
|
1587 |
|
|
1588 |
The default value is an empty icon, i.e. an icon with neither a
|
|
1589 |
pixmap nor a filename.
|
|
1590 |
|
|
1591 |
\sa iconSize
|
|
1592 |
*/
|
|
1593 |
|
|
1594 |
/*!
|
|
1595 |
\variable QStyleOptionButton::iconSize
|
|
1596 |
\brief the size of the icon for the button
|
|
1597 |
|
|
1598 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
1599 |
*/
|
|
1600 |
|
|
1601 |
|
|
1602 |
#ifndef QT_NO_TOOLBAR
|
|
1603 |
/*!
|
|
1604 |
\class QStyleOptionToolBar
|
|
1605 |
\brief The QStyleOptionToolBar class is used to describe the
|
|
1606 |
parameters for drawing a toolbar.
|
|
1607 |
|
|
1608 |
\since 4.1
|
|
1609 |
|
|
1610 |
QStyleOptionToolBar contains all the information that QStyle
|
|
1611 |
functions need to draw QToolBar.
|
|
1612 |
|
|
1613 |
For performance reasons, the access to the member variables is
|
|
1614 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
1615 |
makes the structures straightforward to use and emphasizes that
|
|
1616 |
these are simply parameters used by the style functions.
|
|
1617 |
|
|
1618 |
The QStyleOptionToolBar class holds the lineWidth and the
|
|
1619 |
midLineWidth for drawing the widget. It also stores information
|
|
1620 |
about which \l {toolBarArea}{area} the toolbar should be located
|
|
1621 |
in, whether it is movable or not, which position the toolbar line
|
|
1622 |
should have (positionOfLine), and the toolbar's position within
|
|
1623 |
the line (positionWithinLine).
|
|
1624 |
|
|
1625 |
In addition, the class provides a couple of enums: The
|
|
1626 |
ToolBarFeature enum is used to describe whether a toolbar is
|
|
1627 |
movable or not, and the ToolBarPosition enum is used to describe
|
|
1628 |
the position of a toolbar line, as well as the toolbar's position
|
|
1629 |
within the line.
|
|
1630 |
|
|
1631 |
For an example demonstrating how style options can be used, see
|
|
1632 |
the \l {widgets/styles}{Styles} example.
|
|
1633 |
|
|
1634 |
\sa QStyleOption
|
|
1635 |
*/
|
|
1636 |
|
|
1637 |
/*!
|
|
1638 |
Constructs a QStyleOptionToolBar, initializing the members
|
|
1639 |
variables to their default values.
|
|
1640 |
*/
|
|
1641 |
|
|
1642 |
QStyleOptionToolBar::QStyleOptionToolBar()
|
|
1643 |
: QStyleOption(Version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne),
|
|
1644 |
toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0)
|
|
1645 |
{
|
|
1646 |
}
|
|
1647 |
|
|
1648 |
/*!
|
|
1649 |
\fn QStyleOptionToolBar::QStyleOptionToolBar(const QStyleOptionToolBar &other)
|
|
1650 |
|
|
1651 |
Constructs a copy of the \a other style option.
|
|
1652 |
*/
|
|
1653 |
|
|
1654 |
/*!
|
|
1655 |
\internal
|
|
1656 |
*/
|
|
1657 |
QStyleOptionToolBar::QStyleOptionToolBar(int version)
|
|
1658 |
: QStyleOption(version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne),
|
|
1659 |
toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0)
|
|
1660 |
{
|
|
1661 |
|
|
1662 |
}
|
|
1663 |
|
|
1664 |
/*!
|
|
1665 |
\enum QStyleOptionToolBar::ToolBarPosition
|
|
1666 |
|
|
1667 |
\image qstyleoptiontoolbar-position.png
|
|
1668 |
|
|
1669 |
This enum is used to describe the position of a toolbar line, as
|
|
1670 |
well as the toolbar's position within the line.
|
|
1671 |
|
|
1672 |
The order of the positions within a line starts at the top of a
|
|
1673 |
vertical line, and from the left within a horizontal line. The
|
|
1674 |
order of the positions for the lines is always from the the
|
|
1675 |
parent widget's boundary edges.
|
|
1676 |
|
|
1677 |
\value Beginning The toolbar is located at the beginning of the line,
|
|
1678 |
or the toolbar line is the first of several lines. There can
|
|
1679 |
only be one toolbar (and only one line) with this position.
|
|
1680 |
\value Middle The toolbar is located in the middle of the line,
|
|
1681 |
or the toolbar line is in the middle of several lines. There can
|
|
1682 |
several toolbars (and lines) with this position.
|
|
1683 |
\value End The toolbar is located at the end of the line,
|
|
1684 |
or the toolbar line is the last of several lines. There can
|
|
1685 |
only be one toolbar (and only one line) with this position.
|
|
1686 |
\value OnlyOne There is only one toolbar or line. This is the default value
|
|
1687 |
of the positionOfLine and positionWithinLine variables.
|
|
1688 |
|
|
1689 |
\sa positionWithinLine, positionOfLine
|
|
1690 |
*/
|
|
1691 |
|
|
1692 |
/*!
|
|
1693 |
\enum QStyleOptionToolBar::ToolBarFeature
|
|
1694 |
|
|
1695 |
This enum is used to describe whether a toolbar is movable or not.
|
|
1696 |
|
|
1697 |
\value None The toolbar cannot be moved. The default value.
|
|
1698 |
\value Movable The toolbar is movable, and a handle will appear when
|
|
1699 |
holding the cursor over the toolbar's boundary.
|
|
1700 |
|
|
1701 |
\sa features, QToolBar::isMovable()
|
|
1702 |
*/
|
|
1703 |
|
|
1704 |
/*!
|
|
1705 |
\variable QStyleOptionToolBar::positionOfLine
|
|
1706 |
|
|
1707 |
This variable holds the position of the toolbar line.
|
|
1708 |
|
|
1709 |
The default value is QStyleOptionToolBar::OnlyOne.
|
|
1710 |
*/
|
|
1711 |
|
|
1712 |
/*!
|
|
1713 |
\variable QStyleOptionToolBar::positionWithinLine
|
|
1714 |
|
|
1715 |
This variable holds the position of the toolbar within a line.
|
|
1716 |
|
|
1717 |
The default value is QStyleOptionToolBar::OnlyOne.
|
|
1718 |
*/
|
|
1719 |
|
|
1720 |
/*!
|
|
1721 |
\variable QStyleOptionToolBar::toolBarArea
|
|
1722 |
|
|
1723 |
This variable holds the location for drawing the toolbar.
|
|
1724 |
|
|
1725 |
The default value is Qt::TopToolBarArea.
|
|
1726 |
|
|
1727 |
\sa Qt::ToolBarArea
|
|
1728 |
*/
|
|
1729 |
|
|
1730 |
/*!
|
|
1731 |
\variable QStyleOptionToolBar::features
|
|
1732 |
|
|
1733 |
This variable holds whether the toolbar is movable or not.
|
|
1734 |
|
|
1735 |
The default value is \l None.
|
|
1736 |
*/
|
|
1737 |
|
|
1738 |
/*!
|
|
1739 |
\variable QStyleOptionToolBar::lineWidth
|
|
1740 |
|
|
1741 |
This variable holds the line width for drawing the toolbar.
|
|
1742 |
|
|
1743 |
The default value is 0.
|
|
1744 |
*/
|
|
1745 |
|
|
1746 |
/*!
|
|
1747 |
\variable QStyleOptionToolBar::midLineWidth
|
|
1748 |
|
|
1749 |
This variable holds the mid-line width for drawing the toolbar.
|
|
1750 |
|
|
1751 |
The default value is 0.
|
|
1752 |
*/
|
|
1753 |
|
|
1754 |
/*!
|
|
1755 |
\enum QStyleOptionToolBar::StyleOptionType
|
|
1756 |
|
|
1757 |
This enum is used to hold information about the type of the style
|
|
1758 |
option, and is defined for each QStyleOption subclass.
|
|
1759 |
|
|
1760 |
\value Type The type of style option provided (\l{SO_ToolBar} for
|
|
1761 |
this class).
|
|
1762 |
|
|
1763 |
The type is used internally by QStyleOption, its subclasses, and
|
|
1764 |
qstyleoption_cast() to determine the type of style option. In
|
|
1765 |
general you do not need to worry about this unless you want to
|
|
1766 |
create your own QStyleOption subclass and your own styles.
|
|
1767 |
|
|
1768 |
\sa StyleOptionVersion
|
|
1769 |
*/
|
|
1770 |
|
|
1771 |
/*!
|
|
1772 |
\enum QStyleOptionToolBar::StyleOptionVersion
|
|
1773 |
|
|
1774 |
This enum is used to hold information about the version of the
|
|
1775 |
style option, and is defined for each QStyleOption subclass.
|
|
1776 |
|
|
1777 |
\value Version 1
|
|
1778 |
|
|
1779 |
The version is used by QStyleOption subclasses to implement
|
|
1780 |
extensions without breaking compatibility. If you use
|
|
1781 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1782 |
|
|
1783 |
\sa StyleOptionType
|
|
1784 |
*/
|
|
1785 |
|
|
1786 |
#endif
|
|
1787 |
|
|
1788 |
#ifndef QT_NO_TABBAR
|
|
1789 |
/*!
|
|
1790 |
\class QStyleOptionTab
|
|
1791 |
\brief The QStyleOptionTab class is used to describe the
|
|
1792 |
parameters for drawing a tab bar.
|
|
1793 |
|
|
1794 |
The QStyleOptionTab class is used for drawing several built-in Qt
|
|
1795 |
widgets including \l QTabBar and the panel for \l QTabWidget. Note
|
|
1796 |
that to describe the parameters necessary for drawing a frame in
|
|
1797 |
Qt 4.1 or above, you must use the QStyleOptionFrameV2 subclass.
|
|
1798 |
|
|
1799 |
An instance of the QStyleOptiontabV2 class has
|
|
1800 |
\l{QStyleOption::type} {type} \l SO_Tab and
|
|
1801 |
\l{QStyleOption::version} {version} 1. The type is used internally
|
|
1802 |
by QStyleOption, its subclasses, and qstyleoption_cast() to
|
|
1803 |
determine the type of style option. In general you do not need to
|
|
1804 |
worry about this unless you want to create your own QStyleOption
|
|
1805 |
subclass and your own styles. The version is used by QStyleOption
|
|
1806 |
subclasses to implement extensions without breaking
|
|
1807 |
compatibility. If you use qstyleoption_cast(), you normally do not
|
|
1808 |
need to check it.
|
|
1809 |
|
|
1810 |
If you create your own QStyle subclass, you should handle both
|
|
1811 |
QStyleOptionTab and QStyleOptionTabV2.
|
|
1812 |
|
|
1813 |
For an example demonstrating how style options can be used, see
|
|
1814 |
the \l {widgets/styles}{Styles} example.
|
|
1815 |
|
|
1816 |
\sa QStyleOptionTabV2, QStyleOption
|
|
1817 |
*/
|
|
1818 |
|
|
1819 |
/*!
|
|
1820 |
Constructs a QStyleOptionTab object, initializing the members
|
|
1821 |
variables to their default values.
|
|
1822 |
*/
|
|
1823 |
|
|
1824 |
QStyleOptionTab::QStyleOptionTab()
|
|
1825 |
: QStyleOption(QStyleOptionTab::Version, SO_Tab),
|
|
1826 |
shape(QTabBar::RoundedNorth),
|
|
1827 |
row(0),
|
|
1828 |
position(Beginning),
|
|
1829 |
selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets)
|
|
1830 |
{
|
|
1831 |
}
|
|
1832 |
|
|
1833 |
/*!
|
|
1834 |
\internal
|
|
1835 |
*/
|
|
1836 |
QStyleOptionTab::QStyleOptionTab(int version)
|
|
1837 |
: QStyleOption(version, SO_Tab),
|
|
1838 |
shape(QTabBar::RoundedNorth),
|
|
1839 |
row(0),
|
|
1840 |
position(Beginning),
|
|
1841 |
selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets)
|
|
1842 |
{
|
|
1843 |
}
|
|
1844 |
|
|
1845 |
/*!
|
|
1846 |
\fn QStyleOptionTab::QStyleOptionTab(const QStyleOptionTab &other)
|
|
1847 |
|
|
1848 |
Constructs a copy of the \a other style option.
|
|
1849 |
*/
|
|
1850 |
|
|
1851 |
/*!
|
|
1852 |
\enum QStyleOptionTab::StyleOptionType
|
|
1853 |
|
|
1854 |
This enum is used to hold information about the type of the style option, and
|
|
1855 |
is defined for each QStyleOption subclass.
|
|
1856 |
|
|
1857 |
\value Type The type of style option provided (\l{SO_Tab} for this class).
|
|
1858 |
|
|
1859 |
The type is used internally by QStyleOption, its subclasses, and
|
|
1860 |
qstyleoption_cast() to determine the type of style option. In
|
|
1861 |
general you do not need to worry about this unless you want to
|
|
1862 |
create your own QStyleOption subclass and your own styles.
|
|
1863 |
|
|
1864 |
\sa StyleOptionVersion
|
|
1865 |
*/
|
|
1866 |
|
|
1867 |
/*!
|
|
1868 |
\enum QStyleOptionTab::StyleOptionVersion
|
|
1869 |
|
|
1870 |
This enum is used to hold information about the version of the style option, and
|
|
1871 |
is defined for each QStyleOption subclass.
|
|
1872 |
|
|
1873 |
\value Version 1
|
|
1874 |
|
|
1875 |
The version is used by QStyleOption subclasses to implement
|
|
1876 |
extensions without breaking compatibility. If you use
|
|
1877 |
qstyleoption_cast(), you normally do not need to check it.
|
|
1878 |
|
|
1879 |
\sa StyleOptionType
|
|
1880 |
*/
|
|
1881 |
|
|
1882 |
/*!
|
|
1883 |
\enum QStyleOptionTab::TabPosition
|
|
1884 |
|
|
1885 |
This enum describes the position of the tab.
|
|
1886 |
|
|
1887 |
\value Beginning The tab is the first tab in the tab bar.
|
|
1888 |
\value Middle The tab is neither the first nor the last tab in the tab bar.
|
|
1889 |
\value End The tab is the last tab in the tab bar.
|
|
1890 |
\value OnlyOneTab The tab is both the first and the last tab in the tab bar.
|
|
1891 |
|
|
1892 |
\sa position
|
|
1893 |
*/
|
|
1894 |
|
|
1895 |
/*!
|
|
1896 |
\enum QStyleOptionTab::CornerWidget
|
|
1897 |
|
|
1898 |
These flags indicate the corner widgets in a tab.
|
|
1899 |
|
|
1900 |
\value NoCornerWidgets There are no corner widgets
|
|
1901 |
\value LeftCornerWidget Left corner widget
|
|
1902 |
\value RightCornerWidget Right corner widget
|
|
1903 |
|
|
1904 |
\sa cornerWidgets
|
|
1905 |
*/
|
|
1906 |
|
|
1907 |
/*! \enum QStyleOptionTab::SelectedPosition
|
|
1908 |
|
|
1909 |
This enum describes the position of the selected tab. Some styles
|
|
1910 |
need to draw a tab differently depending on whether or not it is
|
|
1911 |
adjacent to the selected tab.
|
|
1912 |
|
|
1913 |
\value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
|
|
1914 |
\value NextIsSelected The next tab (typically the tab on the right) is selected.
|
|
1915 |
\value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
|
|
1916 |
|
|
1917 |
\sa selectedPosition
|
|
1918 |
*/
|
|
1919 |
|
|
1920 |
/*!
|
|
1921 |
\variable QStyleOptionTab::selectedPosition
|
|
1922 |
\brief the position of the selected tab in relation to this tab
|
|
1923 |
|
|
1924 |
The default value is NotAdjacent, i.e. the tab is not adjacent to
|
|
1925 |
a selected tab nor is it the selected tab.
|
|
1926 |
*/
|
|
1927 |
|
|
1928 |
/*!
|
|
1929 |
\variable QStyleOptionTab::cornerWidgets
|
|
1930 |
\brief an OR combination of CornerWidget values indicating the
|
|
1931 |
corner widgets of the tab bar
|
|
1932 |
|
|
1933 |
The default value is NoCornerWidgets.
|
|
1934 |
|
|
1935 |
\sa CornerWidget
|
|
1936 |
*/
|
|
1937 |
|
|
1938 |
|
|
1939 |
/*!
|
|
1940 |
\variable QStyleOptionTab::shape
|
|
1941 |
\brief the tab shape used to draw the tab; by default
|
|
1942 |
QTabBar::RoundedNorth
|
|
1943 |
|
|
1944 |
\sa QTabBar::Shape
|
|
1945 |
*/
|
|
1946 |
|
|
1947 |
/*!
|
|
1948 |
\variable QStyleOptionTab::text
|
|
1949 |
\brief the text of the tab
|
|
1950 |
|
|
1951 |
The default value is an empty string.
|
|
1952 |
*/
|
|
1953 |
|
|
1954 |
/*!
|
|
1955 |
\variable QStyleOptionTab::icon
|
|
1956 |
\brief the icon for the tab
|
|
1957 |
|
|
1958 |
The default value is an empty icon, i.e. an icon with neither a
|
|
1959 |
pixmap nor a filename.
|
|
1960 |
*/
|
|
1961 |
|
|
1962 |
/*!
|
|
1963 |
\variable QStyleOptionTab::row
|
|
1964 |
\brief which row the tab is currently in
|
|
1965 |
|
|
1966 |
The default value is 0, indicating the front row. Currently this
|
|
1967 |
property can only be 0.
|
|
1968 |
*/
|
|
1969 |
|
|
1970 |
/*!
|
|
1971 |
\variable QStyleOptionTab::position
|
|
1972 |
\brief the position of the tab in the tab bar
|
|
1973 |
|
|
1974 |
The default value is \l Beginning, i.e. the tab is the first tab
|
|
1975 |
in the tab bar.
|
|
1976 |
*/
|
|
1977 |
|
|
1978 |
/*!
|
|
1979 |
\class QStyleOptionTabV2
|
|
1980 |
\brief The QStyleOptionTabV2 class is used to describe the
|
|
1981 |
parameters necessary for drawing a tabs in Qt 4.1 or above.
|
|
1982 |
|
|
1983 |
\since 4.1
|
|
1984 |
|
|
1985 |
An instance of the QStyleOptionTabV2 class has
|
|
1986 |
\l{QStyleOption::type} {type} \l SO_Tab and
|
|
1987 |
\l{QStyleOption::version} {version} 2. The type is used internally
|
|
1988 |
by QStyleOption, its subclasses, and qstyleoption_cast() to
|
|
1989 |
determine the type of style option. In general you do not need to
|
|
1990 |
worry about this unless you want to create your own QStyleOption
|
|
1991 |
subclass and your own styles. The version is used by QStyleOption
|
|
1992 |
subclasses to implement extensions without breaking
|
|
1993 |
compatibility. If you use qstyleoption_cast(), you normally do not
|
|
1994 |
need to check it.
|
|
1995 |
|
|
1996 |
If you create your own QStyle subclass, you should handle both
|
|
1997 |
QStyleOptionTab and QStyleOptionTabV2. One way to achieve this is
|
|
1998 |
to use the QStyleOptionTabV2 copy constructor. For example:
|
|
1999 |
|
|
2000 |
\snippet doc/src/snippets/qstyleoption/main.cpp 3
|
|
2001 |
|
|
2002 |
In the example above: If \c tabOption's version is 1, the extra
|
|
2003 |
member (\l iconSize) will be set to an invalid size for \c tabV2.
|
|
2004 |
If \c tabOption's version is 2, the constructor will simply copy
|
|
2005 |
the \c tab's iconSize.
|
|
2006 |
|
|
2007 |
For an example demonstrating how style options can be used, see
|
|
2008 |
the \l {widgets/styles}{Styles} example.
|
|
2009 |
|
|
2010 |
\sa QStyleOptionTab, QStyleOption
|
|
2011 |
*/
|
|
2012 |
|
|
2013 |
/*!
|
|
2014 |
\enum QStyleOptionTabV2::StyleOptionVersion
|
|
2015 |
|
|
2016 |
This enum is used to hold information about the version of the style option, and
|
|
2017 |
is defined for each QStyleOption subclass.
|
|
2018 |
|
|
2019 |
\value Version 2
|
|
2020 |
|
|
2021 |
The version is used by QStyleOption subclasses to implement
|
|
2022 |
extensions without breaking compatibility. If you use
|
|
2023 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2024 |
|
|
2025 |
\sa StyleOptionType
|
|
2026 |
*/
|
|
2027 |
|
|
2028 |
/*!
|
|
2029 |
\variable QStyleOptionTabV2::iconSize
|
|
2030 |
\brief the size for the icons
|
|
2031 |
|
|
2032 |
The default value is QSize(-1, -1), i.e. an invalid size; use
|
|
2033 |
QStyle::pixelMetric() to find the default icon size for tab bars.
|
|
2034 |
|
|
2035 |
\sa QTabBar::iconSize()
|
|
2036 |
*/
|
|
2037 |
|
|
2038 |
/*!
|
|
2039 |
Constructs a QStyleOptionTabV2.
|
|
2040 |
*/
|
|
2041 |
QStyleOptionTabV2::QStyleOptionTabV2()
|
|
2042 |
: QStyleOptionTab(Version)
|
|
2043 |
{
|
|
2044 |
}
|
|
2045 |
|
|
2046 |
/*!
|
|
2047 |
\internal
|
|
2048 |
*/
|
|
2049 |
QStyleOptionTabV2::QStyleOptionTabV2(int version)
|
|
2050 |
: QStyleOptionTab(version)
|
|
2051 |
{
|
|
2052 |
}
|
|
2053 |
|
|
2054 |
/*!
|
|
2055 |
\fn QStyleOptionTabV2::QStyleOptionTabV2(const QStyleOptionTabV2 &other)
|
|
2056 |
|
|
2057 |
Constructs a copy of the \a other style option.
|
|
2058 |
*/
|
|
2059 |
|
|
2060 |
/*!
|
|
2061 |
Constructs a QStyleOptionTabV2 copy of the \a other style option
|
|
2062 |
which can be either of the QStyleOptionTabV2 or QStyleOptionTab
|
|
2063 |
types.
|
|
2064 |
|
|
2065 |
If the other style option's version is 1, the new style option's
|
|
2066 |
\c iconSize is set to an invalid value. If its version is 2, its
|
|
2067 |
\c iconSize value is simply copied to the new style option.
|
|
2068 |
*/
|
|
2069 |
QStyleOptionTabV2::QStyleOptionTabV2(const QStyleOptionTab &other)
|
|
2070 |
: QStyleOptionTab(Version)
|
|
2071 |
{
|
|
2072 |
if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other)) {
|
|
2073 |
*this = *tab;
|
|
2074 |
} else {
|
|
2075 |
*((QStyleOptionTab *)this) = other;
|
|
2076 |
version = Version;
|
|
2077 |
}
|
|
2078 |
}
|
|
2079 |
|
|
2080 |
/*!
|
|
2081 |
Assigns the \a other style option to this QStyleOptionTabV2. The
|
|
2082 |
\a other style option can be either of the QStyleOptionTabV2 or
|
|
2083 |
QStyleOptionTab types.
|
|
2084 |
|
|
2085 |
If the other style option's version is 1, this style option's \c
|
|
2086 |
iconSize is set to an invalid size. If its version is 2, its \c
|
|
2087 |
iconSize value is simply copied to this style option.
|
|
2088 |
*/
|
|
2089 |
QStyleOptionTabV2 &QStyleOptionTabV2::operator=(const QStyleOptionTab &other)
|
|
2090 |
{
|
|
2091 |
QStyleOptionTab::operator=(other);
|
|
2092 |
|
|
2093 |
if (const QStyleOptionTabV2 *tab = qstyleoption_cast<const QStyleOptionTabV2 *>(&other))
|
|
2094 |
iconSize = tab->iconSize;
|
|
2095 |
else
|
|
2096 |
iconSize = QSize();
|
|
2097 |
return *this;
|
|
2098 |
}
|
|
2099 |
|
|
2100 |
/*!
|
|
2101 |
\class QStyleOptionTabV3
|
|
2102 |
\brief The QStyleOptionTabV3 class is used to describe the
|
|
2103 |
parameters necessary for drawing a tabs in Qt 4.5 or above.
|
|
2104 |
|
|
2105 |
\since 4.5
|
|
2106 |
|
|
2107 |
An instance of the QStyleOptionTabV3 class has
|
|
2108 |
\l{QStyleOption::type} {type} \l SO_Tab and
|
|
2109 |
\l{QStyleOption::version} {version} 3. The type is used internally
|
|
2110 |
by QStyleOption, its subclasses, and qstyleoption_cast() to
|
|
2111 |
determine the type of style option. In general you do not need to
|
|
2112 |
worry about this unless you want to create your own QStyleOption
|
|
2113 |
subclass and your own styles. The version is used by QStyleOption
|
|
2114 |
subclasses to implement extensions without breaking
|
|
2115 |
compatibility. If you use qstyleoption_cast(), you normally do not
|
|
2116 |
need to check it.
|
|
2117 |
|
|
2118 |
If you create your own QStyle subclass, you should handle both
|
|
2119 |
QStyleOptionTab, QStyleOptionTabV2 and QStyleOptionTabV3.
|
|
2120 |
One way to achieve this is to use the QStyleOptionTabV3 copy
|
|
2121 |
constructor. For example:
|
|
2122 |
|
|
2123 |
\snippet doc/src/snippets/qstyleoption/main.cpp 3
|
|
2124 |
|
|
2125 |
In the example above: If \c tabOption's version is 1, the extra
|
|
2126 |
member (\l{QStyleOptionTabV2::iconSize}{iconSize}) will be set to
|
|
2127 |
an invalid size for \c tabV2. If \c tabOption's version is 2, the
|
|
2128 |
constructor will simply copy the \c tab's iconSize.
|
|
2129 |
|
|
2130 |
For an example demonstrating how style options can be used, see
|
|
2131 |
the \l {widgets/styles}{Styles} example.
|
|
2132 |
|
|
2133 |
\sa QStyleOptionTab, QStyleOption
|
|
2134 |
*/
|
|
2135 |
|
|
2136 |
/*!
|
|
2137 |
\enum QStyleOptionTabV3::StyleOptionVersion
|
|
2138 |
|
|
2139 |
This enum is used to hold information about the version of the style option, and
|
|
2140 |
is defined for each QStyleOption subclass.
|
|
2141 |
|
|
2142 |
\value Version 3
|
|
2143 |
|
|
2144 |
The version is used by QStyleOption subclasses to implement
|
|
2145 |
extensions without breaking compatibility. If you use
|
|
2146 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2147 |
|
|
2148 |
\sa StyleOptionType
|
|
2149 |
*/
|
|
2150 |
|
|
2151 |
/*!
|
|
2152 |
\variable QStyleOptionTabV3::documentMode
|
|
2153 |
\brief whether the tabbar is in document mode.
|
|
2154 |
|
|
2155 |
The default value is false;
|
|
2156 |
*/
|
|
2157 |
|
|
2158 |
/*!
|
|
2159 |
\variable QStyleOptionTabV3::leftButtonSize
|
|
2160 |
\brief the size for the left widget on the tab.
|
|
2161 |
|
|
2162 |
The default value is QSize(-1, -1), i.e. an invalid size;
|
|
2163 |
*/
|
|
2164 |
|
|
2165 |
/*!
|
|
2166 |
\variable QStyleOptionTabV3::rightButtonSize
|
|
2167 |
\brief the size for the right widget on the tab.
|
|
2168 |
|
|
2169 |
The default value is QSize(-1, -1), i.e. an invalid size;
|
|
2170 |
*/
|
|
2171 |
|
|
2172 |
/*!
|
|
2173 |
Constructs a QStyleOptionTabV3.
|
|
2174 |
*/
|
|
2175 |
|
|
2176 |
QStyleOptionTabV3::QStyleOptionTabV3()
|
|
2177 |
: QStyleOptionTabV2(Version)
|
|
2178 |
, documentMode(false)
|
|
2179 |
{
|
|
2180 |
}
|
|
2181 |
|
|
2182 |
/*!
|
|
2183 |
\internal
|
|
2184 |
*/
|
|
2185 |
QStyleOptionTabV3::QStyleOptionTabV3(int version)
|
|
2186 |
: QStyleOptionTabV2(version)
|
|
2187 |
{
|
|
2188 |
}
|
|
2189 |
|
|
2190 |
/*!
|
|
2191 |
\fn QStyleOptionTabV3::QStyleOptionTabV3(const QStyleOptionTabV3 &other)
|
|
2192 |
|
|
2193 |
Constructs a copy of the \a other style option.
|
|
2194 |
*/
|
|
2195 |
|
|
2196 |
/*!
|
|
2197 |
\fn QStyleOptionTabV3::QStyleOptionTabV3(const QStyleOptionTabV2 &other)
|
|
2198 |
|
|
2199 |
Constructs a copy of the \a other style option.
|
|
2200 |
*/
|
|
2201 |
|
|
2202 |
/*!
|
|
2203 |
Constructs a QStyleOptionTabV3 copy of the \a other style option
|
|
2204 |
which can be either of the QStyleOptionTabV3, QStyleOptionTabV2
|
|
2205 |
or QStyleOptionTab types.
|
|
2206 |
|
|
2207 |
If the other style option's version is 1 or 2, the new style option's
|
|
2208 |
\c leftButtonSize and \c rightButtonSize is set to an invalid value. If
|
|
2209 |
its version is 3, its \c leftButtonSize and \c rightButtonSize values
|
|
2210 |
are simply copied to the new style option.
|
|
2211 |
*/
|
|
2212 |
QStyleOptionTabV3::QStyleOptionTabV3(const QStyleOptionTab &other)
|
|
2213 |
: QStyleOptionTabV2(Version)
|
|
2214 |
{
|
|
2215 |
if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(&other)) {
|
|
2216 |
*this = *tab;
|
|
2217 |
} else {
|
|
2218 |
*((QStyleOptionTabV2 *)this) = other;
|
|
2219 |
version = Version;
|
|
2220 |
}
|
|
2221 |
}
|
|
2222 |
|
|
2223 |
/*!
|
|
2224 |
Assigns the \a other style option to this QStyleOptionTabV3. The
|
|
2225 |
\a other style option can be either of the QStyleOptionTabV3,
|
|
2226 |
QStyleOptionTabV2 or QStyleOptionTab types.
|
|
2227 |
|
|
2228 |
If the other style option's version is 1 or 2, the new style option's
|
|
2229 |
\c leftButtonSize and \c rightButtonSize is set to an invalid value. If
|
|
2230 |
its version is 3, its \c leftButtonSize and \c rightButtonSize values
|
|
2231 |
are simply copied to the new style option.
|
|
2232 |
*/
|
|
2233 |
QStyleOptionTabV3 &QStyleOptionTabV3::operator=(const QStyleOptionTab &other)
|
|
2234 |
{
|
|
2235 |
QStyleOptionTabV2::operator=(other);
|
|
2236 |
|
|
2237 |
if (const QStyleOptionTabV3 *tab = qstyleoption_cast<const QStyleOptionTabV3 *>(&other)) {
|
|
2238 |
leftButtonSize = tab->leftButtonSize;
|
|
2239 |
rightButtonSize = tab->rightButtonSize;
|
|
2240 |
} else {
|
|
2241 |
leftButtonSize = QSize();
|
|
2242 |
rightButtonSize = QSize();
|
|
2243 |
documentMode = false;
|
|
2244 |
}
|
|
2245 |
return *this;
|
|
2246 |
}
|
|
2247 |
|
|
2248 |
#endif // QT_NO_TABBAR
|
|
2249 |
|
|
2250 |
/*!
|
|
2251 |
\class QStyleOptionProgressBar
|
|
2252 |
\brief The QStyleOptionProgressBar class is used to describe the
|
|
2253 |
parameters necessary for drawing a progress bar.
|
|
2254 |
|
|
2255 |
Since Qt 4.1, Qt uses the QStyleOptionProgressBarV2 subclass for
|
|
2256 |
drawing QProgressBar.
|
|
2257 |
|
|
2258 |
An instance of the QStyleOptionProgressBar class has type
|
|
2259 |
SO_ProgressBar and version 1.
|
|
2260 |
|
|
2261 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2262 |
qstyleoption_cast() to determine the type of style option. In
|
|
2263 |
general you do not need to worry about this unless you want to
|
|
2264 |
create your own QStyleOption subclass and your own styles. The
|
|
2265 |
version is used by QStyleOption subclasses to implement extensions
|
|
2266 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
2267 |
you normally do not need to check it.
|
|
2268 |
|
|
2269 |
If you create your own QStyle subclass, you should handle both
|
|
2270 |
QStyleOptionProgressBar and QStyleOptionProgressBarV2.
|
|
2271 |
|
|
2272 |
For an example demonstrating how style options can be used, see
|
|
2273 |
the \l {widgets/styles}{Styles} example.
|
|
2274 |
|
|
2275 |
\sa QStyleOptionProgressBarV2, QStyleOption
|
|
2276 |
*/
|
|
2277 |
|
|
2278 |
/*!
|
|
2279 |
Constructs a QStyleOptionProgressBar, initializing the members
|
|
2280 |
variables to their default values.
|
|
2281 |
*/
|
|
2282 |
|
|
2283 |
QStyleOptionProgressBar::QStyleOptionProgressBar()
|
|
2284 |
: QStyleOption(QStyleOptionProgressBar::Version, SO_ProgressBar),
|
|
2285 |
minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false)
|
|
2286 |
{
|
|
2287 |
}
|
|
2288 |
|
|
2289 |
/*!
|
|
2290 |
\internal
|
|
2291 |
*/
|
|
2292 |
QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
|
|
2293 |
: QStyleOption(version, SO_ProgressBar),
|
|
2294 |
minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false)
|
|
2295 |
{
|
|
2296 |
}
|
|
2297 |
|
|
2298 |
/*!
|
|
2299 |
\fn QStyleOptionProgressBar::QStyleOptionProgressBar(const QStyleOptionProgressBar &other)
|
|
2300 |
|
|
2301 |
Constructs a copy of the \a other style option.
|
|
2302 |
*/
|
|
2303 |
|
|
2304 |
/*!
|
|
2305 |
\enum QStyleOptionProgressBar::StyleOptionType
|
|
2306 |
|
|
2307 |
This enum is used to hold information about the type of the style option, and
|
|
2308 |
is defined for each QStyleOption subclass.
|
|
2309 |
|
|
2310 |
\value Type The type of style option provided (\l{SO_ProgressBar} for this class).
|
|
2311 |
|
|
2312 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2313 |
qstyleoption_cast() to determine the type of style option. In
|
|
2314 |
general you do not need to worry about this unless you want to
|
|
2315 |
create your own QStyleOption subclass and your own styles.
|
|
2316 |
|
|
2317 |
\sa StyleOptionVersion
|
|
2318 |
*/
|
|
2319 |
|
|
2320 |
/*!
|
|
2321 |
\enum QStyleOptionProgressBar::StyleOptionVersion
|
|
2322 |
|
|
2323 |
This enum is used to hold information about the version of the style option, and
|
|
2324 |
is defined for each QStyleOption subclass.
|
|
2325 |
|
|
2326 |
\value Version 1
|
|
2327 |
|
|
2328 |
The version is used by QStyleOption subclasses to implement
|
|
2329 |
extensions without breaking compatibility. If you use
|
|
2330 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2331 |
|
|
2332 |
\sa StyleOptionType
|
|
2333 |
*/
|
|
2334 |
|
|
2335 |
/*!
|
|
2336 |
\variable QStyleOptionProgressBar::minimum
|
|
2337 |
\brief the minimum value for the progress bar
|
|
2338 |
|
|
2339 |
This is the minimum value in the progress bar. The default value
|
|
2340 |
is 0.
|
|
2341 |
|
|
2342 |
\sa QProgressBar::minimum
|
|
2343 |
*/
|
|
2344 |
|
|
2345 |
/*!
|
|
2346 |
\variable QStyleOptionProgressBar::maximum
|
|
2347 |
\brief the maximum value for the progress bar
|
|
2348 |
|
|
2349 |
This is the maximum value in the progress bar. The default value
|
|
2350 |
is 0.
|
|
2351 |
|
|
2352 |
\sa QProgressBar::maximum
|
|
2353 |
*/
|
|
2354 |
|
|
2355 |
/*!
|
|
2356 |
\variable QStyleOptionProgressBar::text
|
|
2357 |
\brief the text for the progress bar
|
|
2358 |
|
|
2359 |
The progress bar text is usually just the progress expressed as a
|
|
2360 |
string. An empty string indicates that the progress bar has not
|
|
2361 |
started yet. The default value is an empty string.
|
|
2362 |
|
|
2363 |
\sa QProgressBar::text
|
|
2364 |
*/
|
|
2365 |
|
|
2366 |
/*!
|
|
2367 |
\variable QStyleOptionProgressBar::textVisible
|
|
2368 |
\brief a flag indicating whether or not text is visible
|
|
2369 |
|
|
2370 |
If this flag is true then the text is visible. Otherwise, the text
|
|
2371 |
is not visible. The default value is false.
|
|
2372 |
|
|
2373 |
\sa QProgressBar::textVisible
|
|
2374 |
*/
|
|
2375 |
|
|
2376 |
|
|
2377 |
/*!
|
|
2378 |
\variable QStyleOptionProgressBar::textAlignment
|
|
2379 |
\brief the text alignment for the text in the QProgressBar
|
|
2380 |
|
|
2381 |
This can be used as a guide on where the text should be in the
|
|
2382 |
progress bar. The default value is Qt::AlignLeft.
|
|
2383 |
*/
|
|
2384 |
|
|
2385 |
/*!
|
|
2386 |
\variable QStyleOptionProgressBar::progress
|
|
2387 |
\brief the current progress for the progress bar
|
|
2388 |
|
|
2389 |
The current progress. A value of QStyleOptionProgressBar::minimum
|
|
2390 |
- 1 indicates that the progress hasn't started yet. The default
|
|
2391 |
value is 0.
|
|
2392 |
|
|
2393 |
\sa QProgressBar::value
|
|
2394 |
*/
|
|
2395 |
|
|
2396 |
/*!
|
|
2397 |
\class QStyleOptionProgressBarV2
|
|
2398 |
\brief The QStyleOptionProgressBarV2 class is used to describe the
|
|
2399 |
parameters necessary for drawing a progress bar in Qt 4.1 or above.
|
|
2400 |
|
|
2401 |
\since 4.1
|
|
2402 |
|
|
2403 |
An instance of this class has \l{QStyleOption::type} {type}
|
|
2404 |
SO_ProgressBar and \l{QStyleOption::version} {version} 2.
|
|
2405 |
|
|
2406 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2407 |
qstyleoption_cast() to determine the type of style option. In
|
|
2408 |
general you do not need to worry about this unless you want to
|
|
2409 |
create your own QStyleOption subclass and your own styles. The
|
|
2410 |
version is used by QStyleOption subclasses to implement extensions
|
|
2411 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
2412 |
you normally do not need to check it.
|
|
2413 |
|
|
2414 |
If you create your own QStyle subclass, you should handle both
|
|
2415 |
QStyleOptionProgressBar and QStyleOptionProgressBarV2. One way
|
|
2416 |
to achieve this is to use the QStyleOptionProgressBarV2 copy
|
|
2417 |
constructor. For example:
|
|
2418 |
|
|
2419 |
\snippet doc/src/snippets/qstyleoption/main.cpp 2
|
|
2420 |
|
|
2421 |
In the example above: If the \c progressBarOption's version is 1,
|
|
2422 |
the extra members (\l orientation, \l invertedAppearance, and \l
|
|
2423 |
bottomToTop) are set to default values for \c progressBarV2. If
|
|
2424 |
the \c progressBarOption's version is 2, the constructor will
|
|
2425 |
simply copy the extra members to progressBarV2.
|
|
2426 |
|
|
2427 |
For an example demonstrating how style options can be used, see
|
|
2428 |
the \l {widgets/styles}{Styles} example.
|
|
2429 |
|
|
2430 |
\sa QStyleOptionProgressBar, QStyleOption
|
|
2431 |
*/
|
|
2432 |
|
|
2433 |
/*!
|
|
2434 |
Constructs a QStyleOptionProgressBarV2, initializing he members
|
|
2435 |
variables to their default values.
|
|
2436 |
*/
|
|
2437 |
|
|
2438 |
QStyleOptionProgressBarV2::QStyleOptionProgressBarV2()
|
|
2439 |
: QStyleOptionProgressBar(2),
|
|
2440 |
orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
|
|
2441 |
{
|
|
2442 |
}
|
|
2443 |
|
|
2444 |
/*!
|
|
2445 |
\internal
|
|
2446 |
*/
|
|
2447 |
QStyleOptionProgressBarV2::QStyleOptionProgressBarV2(int version)
|
|
2448 |
: QStyleOptionProgressBar(version),
|
|
2449 |
orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
|
|
2450 |
{
|
|
2451 |
}
|
|
2452 |
|
|
2453 |
/*!
|
|
2454 |
Constructs a copy of the \a other style option which can be either
|
|
2455 |
of the QStyleOptionProgressBar and QStyleOptionProgressBarV2
|
|
2456 |
types.
|
|
2457 |
|
|
2458 |
If the \a{other} style option's version is 1, the extra members (\l
|
|
2459 |
orientation, \l invertedAppearance, and \l bottomToTop) are set
|
|
2460 |
to default values for the new style option. If \a{other}'s version
|
|
2461 |
is 2, the extra members are simply copied.
|
|
2462 |
|
|
2463 |
\sa version
|
|
2464 |
*/
|
|
2465 |
QStyleOptionProgressBarV2::QStyleOptionProgressBarV2(const QStyleOptionProgressBar &other)
|
|
2466 |
: QStyleOptionProgressBar(2), orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
|
|
2467 |
{
|
|
2468 |
const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(&other);
|
|
2469 |
if (pb2)
|
|
2470 |
*this = *pb2;
|
|
2471 |
else
|
|
2472 |
*((QStyleOptionProgressBar *)this) = other;
|
|
2473 |
}
|
|
2474 |
|
|
2475 |
/*!
|
|
2476 |
Constructs a copy of the \a other style option.
|
|
2477 |
*/
|
|
2478 |
QStyleOptionProgressBarV2::QStyleOptionProgressBarV2(const QStyleOptionProgressBarV2 &other)
|
|
2479 |
: QStyleOptionProgressBar(2), orientation(Qt::Horizontal), invertedAppearance(false), bottomToTop(false)
|
|
2480 |
{
|
|
2481 |
*this = other;
|
|
2482 |
}
|
|
2483 |
|
|
2484 |
/*!
|
|
2485 |
Assigns the \a other style option to this style option. The \a
|
|
2486 |
other style option can be either of the QStyleOptionProgressBarV2
|
|
2487 |
or QStyleOptionProgressBar types.
|
|
2488 |
|
|
2489 |
If the \a{other} style option's version is 1, the extra members
|
|
2490 |
(\l orientation, \l invertedAppearance, and \l bottomToTop) are
|
|
2491 |
set to default values for this style option. If \a{other}'s
|
|
2492 |
version is 2, the extra members are simply copied to this style
|
|
2493 |
option.
|
|
2494 |
*/
|
|
2495 |
QStyleOptionProgressBarV2 &QStyleOptionProgressBarV2::operator=(const QStyleOptionProgressBar &other)
|
|
2496 |
{
|
|
2497 |
QStyleOptionProgressBar::operator=(other);
|
|
2498 |
|
|
2499 |
const QStyleOptionProgressBarV2 *pb2 = qstyleoption_cast<const QStyleOptionProgressBarV2 *>(&other);
|
|
2500 |
orientation = pb2 ? pb2->orientation : Qt::Horizontal;
|
|
2501 |
invertedAppearance = pb2 ? pb2->invertedAppearance : false;
|
|
2502 |
bottomToTop = pb2 ? pb2->bottomToTop : false;
|
|
2503 |
return *this;
|
|
2504 |
}
|
|
2505 |
|
|
2506 |
/*!
|
|
2507 |
\variable QStyleOptionProgressBarV2::orientation
|
|
2508 |
\brief the progress bar's orientation (horizontal or vertical);
|
|
2509 |
the default orentation is Qt::Horizontal
|
|
2510 |
|
|
2511 |
\sa QProgressBar::orientation
|
|
2512 |
*/
|
|
2513 |
|
|
2514 |
/*!
|
|
2515 |
\variable QStyleOptionProgressBarV2::invertedAppearance
|
|
2516 |
\brief whether the progress bar's appearance is inverted
|
|
2517 |
|
|
2518 |
The default value is false.
|
|
2519 |
|
|
2520 |
\sa QProgressBar::invertedAppearance
|
|
2521 |
*/
|
|
2522 |
|
|
2523 |
/*!
|
|
2524 |
\variable QStyleOptionProgressBarV2::bottomToTop
|
|
2525 |
\brief whether the text reads from bottom to top when the progress
|
|
2526 |
bar is vertical
|
|
2527 |
|
|
2528 |
The default value is false.
|
|
2529 |
|
|
2530 |
\sa QProgressBar::textDirection
|
|
2531 |
*/
|
|
2532 |
|
|
2533 |
/*!
|
|
2534 |
\enum QStyleOptionProgressBarV2::StyleOptionType
|
|
2535 |
|
|
2536 |
This enum is used to hold information about the type of the style option, and
|
|
2537 |
is defined for each QStyleOption subclass.
|
|
2538 |
|
|
2539 |
\value Type The type of style option provided (\l{SO_ProgressBar} for this class).
|
|
2540 |
|
|
2541 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2542 |
qstyleoption_cast() to determine the type of style option. In
|
|
2543 |
general you do not need to worry about this unless you want to
|
|
2544 |
create your own QStyleOption subclass and your own styles.
|
|
2545 |
|
|
2546 |
\sa StyleOptionVersion
|
|
2547 |
*/
|
|
2548 |
|
|
2549 |
/*!
|
|
2550 |
\enum QStyleOptionProgressBarV2::StyleOptionVersion
|
|
2551 |
|
|
2552 |
This enum is used to hold information about the version of the style option, and
|
|
2553 |
is defined for each QStyleOption subclass.
|
|
2554 |
|
|
2555 |
\value Version 2
|
|
2556 |
|
|
2557 |
The version is used by QStyleOption subclasses to implement
|
|
2558 |
extensions without breaking compatibility. If you use
|
|
2559 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2560 |
|
|
2561 |
\sa StyleOptionType
|
|
2562 |
*/
|
|
2563 |
|
|
2564 |
|
|
2565 |
/*!
|
|
2566 |
\class QStyleOptionMenuItem
|
|
2567 |
\brief The QStyleOptionMenuItem class is used to describe the
|
|
2568 |
parameter necessary for drawing a menu item.
|
|
2569 |
|
|
2570 |
QStyleOptionMenuItem contains all the information that QStyle
|
|
2571 |
functions need to draw the menu items from \l QMenu. It is also
|
|
2572 |
used for drawing other menu-related widgets.
|
|
2573 |
|
|
2574 |
For performance reasons, the access to the member variables is
|
|
2575 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
2576 |
makes the structures straightforward to use and emphasizes that
|
|
2577 |
these are simply parameters used by the style functions.
|
|
2578 |
|
|
2579 |
For an example demonstrating how style options can be used, see
|
|
2580 |
the \l {widgets/styles}{Styles} example.
|
|
2581 |
|
|
2582 |
\sa QStyleOption
|
|
2583 |
*/
|
|
2584 |
|
|
2585 |
/*!
|
|
2586 |
Constructs a QStyleOptionMenuItem, initializing the members
|
|
2587 |
variables to their default values.
|
|
2588 |
*/
|
|
2589 |
|
|
2590 |
QStyleOptionMenuItem::QStyleOptionMenuItem()
|
|
2591 |
: QStyleOption(QStyleOptionMenuItem::Version, SO_MenuItem), menuItemType(Normal),
|
|
2592 |
checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
|
|
2593 |
{
|
|
2594 |
}
|
|
2595 |
|
|
2596 |
/*!
|
|
2597 |
\internal
|
|
2598 |
*/
|
|
2599 |
QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
|
|
2600 |
: QStyleOption(version, SO_MenuItem), menuItemType(Normal),
|
|
2601 |
checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0), tabWidth(0)
|
|
2602 |
{
|
|
2603 |
}
|
|
2604 |
|
|
2605 |
/*!
|
|
2606 |
\fn QStyleOptionMenuItem::QStyleOptionMenuItem(const QStyleOptionMenuItem &other)
|
|
2607 |
|
|
2608 |
Constructs a copy of the \a other style option.
|
|
2609 |
*/
|
|
2610 |
|
|
2611 |
/*!
|
|
2612 |
\enum QStyleOptionMenuItem::StyleOptionType
|
|
2613 |
|
|
2614 |
This enum is used to hold information about the type of the style option, and
|
|
2615 |
is defined for each QStyleOption subclass.
|
|
2616 |
|
|
2617 |
\value Type The type of style option provided (\l{SO_MenuItem} for this class).
|
|
2618 |
|
|
2619 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2620 |
qstyleoption_cast() to determine the type of style option. In
|
|
2621 |
general you do not need to worry about this unless you want to
|
|
2622 |
create your own QStyleOption subclass and your own styles.
|
|
2623 |
|
|
2624 |
\sa StyleOptionVersion
|
|
2625 |
*/
|
|
2626 |
|
|
2627 |
/*!
|
|
2628 |
\enum QStyleOptionMenuItem::StyleOptionVersion
|
|
2629 |
|
|
2630 |
This enum is used to hold information about the version of the style option, and
|
|
2631 |
is defined for each QStyleOption subclass.
|
|
2632 |
|
|
2633 |
\value Version 1
|
|
2634 |
|
|
2635 |
The version is used by QStyleOption subclasses to implement
|
|
2636 |
extensions without breaking compatibility. If you use
|
|
2637 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2638 |
|
|
2639 |
\sa StyleOptionType
|
|
2640 |
*/
|
|
2641 |
|
|
2642 |
/*!
|
|
2643 |
\enum QStyleOptionMenuItem::MenuItemType
|
|
2644 |
|
|
2645 |
This enum indicates the type of menu item that the structure describes.
|
|
2646 |
|
|
2647 |
\value Normal A normal menu item.
|
|
2648 |
\value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction().
|
|
2649 |
\value Separator A menu separator.
|
|
2650 |
\value SubMenu Indicates the menu item points to a sub-menu.
|
|
2651 |
\value Scroller A popup menu scroller (currently only used on Mac OS X).
|
|
2652 |
\value TearOff A tear-off handle for the menu.
|
|
2653 |
\value Margin The margin of the menu.
|
|
2654 |
\value EmptyArea The empty area of the menu.
|
|
2655 |
|
|
2656 |
\sa menuItemType
|
|
2657 |
*/
|
|
2658 |
|
|
2659 |
/*!
|
|
2660 |
\enum QStyleOptionMenuItem::CheckType
|
|
2661 |
|
|
2662 |
This enum is used to indicate whether or not a check mark should be
|
|
2663 |
drawn for the item, or even if it should be drawn at all.
|
|
2664 |
|
|
2665 |
\value NotCheckable The item is not checkable.
|
|
2666 |
\value Exclusive The item is an exclusive check item (like a radio button).
|
|
2667 |
\value NonExclusive The item is a non-exclusive check item (like a check box).
|
|
2668 |
|
|
2669 |
\sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusive
|
|
2670 |
*/
|
|
2671 |
|
|
2672 |
/*!
|
|
2673 |
\variable QStyleOptionMenuItem::menuItemType
|
|
2674 |
\brief the type of menu item
|
|
2675 |
|
|
2676 |
The default value is \l Normal.
|
|
2677 |
|
|
2678 |
\sa MenuItemType
|
|
2679 |
*/
|
|
2680 |
|
|
2681 |
/*!
|
|
2682 |
\variable QStyleOptionMenuItem::checkType
|
|
2683 |
\brief the type of checkmark of the menu item
|
|
2684 |
|
|
2685 |
The default value is \l NotCheckable.
|
|
2686 |
|
|
2687 |
\sa CheckType
|
|
2688 |
*/
|
|
2689 |
|
|
2690 |
/*!
|
|
2691 |
\variable QStyleOptionMenuItem::checked
|
|
2692 |
\brief whether the menu item is checked or not
|
|
2693 |
|
|
2694 |
The default value is false.
|
|
2695 |
*/
|
|
2696 |
|
|
2697 |
/*!
|
|
2698 |
\variable QStyleOptionMenuItem::menuHasCheckableItems
|
|
2699 |
\brief whether the menu as a whole has checkable items or not
|
|
2700 |
|
|
2701 |
The default value is true.
|
|
2702 |
|
|
2703 |
If this option is set to false, then the menu has no checkable
|
|
2704 |
items. This makes it possible for GUI styles to save some
|
|
2705 |
horizontal space that would normally be used for the check column.
|
|
2706 |
*/
|
|
2707 |
|
|
2708 |
/*!
|
|
2709 |
\variable QStyleOptionMenuItem::menuRect
|
|
2710 |
\brief the rectangle for the entire menu
|
|
2711 |
|
|
2712 |
The default value is a null rectangle, i.e. a rectangle with both
|
|
2713 |
the width and the height set to 0.
|
|
2714 |
*/
|
|
2715 |
|
|
2716 |
/*!
|
|
2717 |
\variable QStyleOptionMenuItem::text
|
|
2718 |
\brief the text for the menu item
|
|
2719 |
|
|
2720 |
Note that the text format is something like this "Menu
|
|
2721 |
text\bold{\\t}Shortcut".
|
|
2722 |
|
|
2723 |
If the menu item doesn't have a shortcut, it will just contain the
|
|
2724 |
menu item's text. The default value is an empty string.
|
|
2725 |
*/
|
|
2726 |
|
|
2727 |
/*!
|
|
2728 |
\variable QStyleOptionMenuItem::icon
|
|
2729 |
\brief the icon for the menu item
|
|
2730 |
|
|
2731 |
The default value is an empty icon, i.e. an icon with neither a
|
|
2732 |
pixmap nor a filename.
|
|
2733 |
*/
|
|
2734 |
|
|
2735 |
/*!
|
|
2736 |
\variable QStyleOptionMenuItem::maxIconWidth
|
|
2737 |
\brief the maximum icon width for the icon in the menu item
|
|
2738 |
|
|
2739 |
This can be used for drawing the icon into the correct place or
|
|
2740 |
properly aligning items. The variable must be set regardless of
|
|
2741 |
whether or not the menu item has an icon. The default value is 0.
|
|
2742 |
*/
|
|
2743 |
|
|
2744 |
/*!
|
|
2745 |
\variable QStyleOptionMenuItem::tabWidth
|
|
2746 |
\brief the tab width for the menu item
|
|
2747 |
|
|
2748 |
The tab width is the distance between the text of the menu item
|
|
2749 |
and the shortcut. The default value is 0.
|
|
2750 |
*/
|
|
2751 |
|
|
2752 |
|
|
2753 |
/*!
|
|
2754 |
\variable QStyleOptionMenuItem::font
|
|
2755 |
\brief the font used for the menu item text
|
|
2756 |
|
|
2757 |
This is the font that should be used for drawing the menu text
|
|
2758 |
minus the shortcut. The shortcut is usually drawn using the
|
|
2759 |
painter's font. By default, the application's default font is
|
|
2760 |
used.
|
|
2761 |
*/
|
|
2762 |
|
|
2763 |
/*!
|
|
2764 |
\class QStyleOptionComplex
|
|
2765 |
\brief The QStyleOptionComplex class is used to hold parameters that are
|
|
2766 |
common to all complex controls.
|
|
2767 |
|
|
2768 |
This class is not used on its own. Instead it is used to derive
|
|
2769 |
other complex control options, for example QStyleOptionSlider and
|
|
2770 |
QStyleOptionSpinBox.
|
|
2771 |
|
|
2772 |
For performance reasons, the access to the member variables is
|
|
2773 |
direct (i.e., using the \c . or \c -> operator).
|
|
2774 |
|
|
2775 |
For an example demonstrating how style options can be used, see
|
|
2776 |
the \l {widgets/styles}{Styles} example.
|
|
2777 |
|
|
2778 |
\sa QStyleOption
|
|
2779 |
*/
|
|
2780 |
|
|
2781 |
/*!
|
|
2782 |
Constructs a QStyleOptionComplex of the specified \a type and \a
|
|
2783 |
version, initializing the member variables to their default
|
|
2784 |
values. This constructor is usually called by subclasses.
|
|
2785 |
*/
|
|
2786 |
|
|
2787 |
QStyleOptionComplex::QStyleOptionComplex(int version, int type)
|
|
2788 |
: QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None)
|
|
2789 |
{
|
|
2790 |
}
|
|
2791 |
|
|
2792 |
/*!
|
|
2793 |
\fn QStyleOptionComplex::QStyleOptionComplex(const QStyleOptionComplex &other)
|
|
2794 |
|
|
2795 |
Constructs a copy of the \a other style option.
|
|
2796 |
*/
|
|
2797 |
|
|
2798 |
/*!
|
|
2799 |
\enum QStyleOptionComplex::StyleOptionType
|
|
2800 |
|
|
2801 |
This enum is used to hold information about the type of the style option, and
|
|
2802 |
is defined for each QStyleOption subclass.
|
|
2803 |
|
|
2804 |
\value Type The type of style option provided (\l{SO_Complex} for this class).
|
|
2805 |
|
|
2806 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2807 |
qstyleoption_cast() to determine the type of style option. In
|
|
2808 |
general you do not need to worry about this unless you want to
|
|
2809 |
create your own QStyleOption subclass and your own styles.
|
|
2810 |
|
|
2811 |
\sa StyleOptionVersion
|
|
2812 |
*/
|
|
2813 |
|
|
2814 |
/*!
|
|
2815 |
\enum QStyleOptionComplex::StyleOptionVersion
|
|
2816 |
|
|
2817 |
This enum is used to hold information about the version of the style option, and
|
|
2818 |
is defined for each QStyleOption subclass.
|
|
2819 |
|
|
2820 |
\value Version 1
|
|
2821 |
|
|
2822 |
The version is used by QStyleOption subclasses to implement
|
|
2823 |
extensions without breaking compatibility. If you use
|
|
2824 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2825 |
|
|
2826 |
\sa StyleOptionType
|
|
2827 |
*/
|
|
2828 |
|
|
2829 |
/*!
|
|
2830 |
\variable QStyleOptionComplex::subControls
|
|
2831 |
\brief a bitwise OR of the various sub-controls that need to be
|
|
2832 |
drawn for the complex control
|
|
2833 |
|
|
2834 |
The default value is QStyle::SC_All.
|
|
2835 |
|
|
2836 |
\sa QStyle::SubControl
|
|
2837 |
*/
|
|
2838 |
|
|
2839 |
/*!
|
|
2840 |
\variable QStyleOptionComplex::activeSubControls
|
|
2841 |
\brief a bitwise OR of the various sub-controls that are active
|
|
2842 |
(pressed) for the complex control
|
|
2843 |
|
|
2844 |
The default value is QStyle::SC_None.
|
|
2845 |
|
|
2846 |
\sa QStyle::SubControl
|
|
2847 |
*/
|
|
2848 |
|
|
2849 |
#ifndef QT_NO_SLIDER
|
|
2850 |
/*!
|
|
2851 |
\class QStyleOptionSlider
|
|
2852 |
\brief The QStyleOptionSlider class is used to describe the
|
|
2853 |
parameters needed for drawing a slider.
|
|
2854 |
|
|
2855 |
QStyleOptionSlider contains all the information that QStyle
|
|
2856 |
functions need to draw QSlider and QScrollBar.
|
|
2857 |
|
|
2858 |
For performance reasons, the access to the member variables is
|
|
2859 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
2860 |
makes the structures straightforward to use and emphasizes that
|
|
2861 |
these are simply parameters used by the style functions.
|
|
2862 |
|
|
2863 |
For an example demonstrating how style options can be used, see
|
|
2864 |
the \l {widgets/styles}{Styles} example.
|
|
2865 |
|
|
2866 |
\sa QStyleOptionComplex, QSlider, QScrollBar
|
|
2867 |
*/
|
|
2868 |
|
|
2869 |
/*!
|
|
2870 |
Constructs a QStyleOptionSlider, initializing the members
|
|
2871 |
variables to their default values.
|
|
2872 |
*/
|
|
2873 |
|
|
2874 |
QStyleOptionSlider::QStyleOptionSlider()
|
|
2875 |
: QStyleOptionComplex(Version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
|
|
2876 |
tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
|
|
2877 |
sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
|
|
2878 |
dialWrapping(false)
|
|
2879 |
{
|
|
2880 |
}
|
|
2881 |
|
|
2882 |
/*!
|
|
2883 |
\internal
|
|
2884 |
*/
|
|
2885 |
QStyleOptionSlider::QStyleOptionSlider(int version)
|
|
2886 |
: QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
|
|
2887 |
tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
|
|
2888 |
sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
|
|
2889 |
dialWrapping(false)
|
|
2890 |
{
|
|
2891 |
}
|
|
2892 |
|
|
2893 |
/*!
|
|
2894 |
\fn QStyleOptionSlider::QStyleOptionSlider(const QStyleOptionSlider &other)
|
|
2895 |
|
|
2896 |
Constructs a copy of the \a other style option.
|
|
2897 |
*/
|
|
2898 |
|
|
2899 |
/*!
|
|
2900 |
\enum QStyleOptionSlider::StyleOptionType
|
|
2901 |
|
|
2902 |
This enum is used to hold information about the type of the style option, and
|
|
2903 |
is defined for each QStyleOption subclass.
|
|
2904 |
|
|
2905 |
\value Type The type of style option provided (\l{SO_Slider} for this class).
|
|
2906 |
|
|
2907 |
The type is used internally by QStyleOption, its subclasses, and
|
|
2908 |
qstyleoption_cast() to determine the type of style option. In
|
|
2909 |
general you do not need to worry about this unless you want to
|
|
2910 |
create your own QStyleOption subclass and your own styles.
|
|
2911 |
|
|
2912 |
\sa StyleOptionVersion
|
|
2913 |
*/
|
|
2914 |
|
|
2915 |
/*!
|
|
2916 |
\enum QStyleOptionSlider::StyleOptionVersion
|
|
2917 |
|
|
2918 |
This enum is used to hold information about the version of the style option, and
|
|
2919 |
is defined for each QStyleOption subclass.
|
|
2920 |
|
|
2921 |
\value Version 1
|
|
2922 |
|
|
2923 |
The version is used by QStyleOption subclasses to implement
|
|
2924 |
extensions without breaking compatibility. If you use
|
|
2925 |
qstyleoption_cast(), you normally do not need to check it.
|
|
2926 |
|
|
2927 |
\sa StyleOptionType
|
|
2928 |
*/
|
|
2929 |
|
|
2930 |
/*!
|
|
2931 |
\variable QStyleOptionSlider::orientation
|
|
2932 |
\brief the slider's orientation (horizontal or vertical)
|
|
2933 |
|
|
2934 |
The default orientation is Qt::Horizontal.
|
|
2935 |
|
|
2936 |
\sa Qt::Orientation
|
|
2937 |
*/
|
|
2938 |
|
|
2939 |
/*!
|
|
2940 |
\variable QStyleOptionSlider::minimum
|
|
2941 |
\brief the minimum value for the slider
|
|
2942 |
|
|
2943 |
The default value is 0.
|
|
2944 |
*/
|
|
2945 |
|
|
2946 |
/*!
|
|
2947 |
\variable QStyleOptionSlider::maximum
|
|
2948 |
\brief the maximum value for the slider
|
|
2949 |
|
|
2950 |
The default value is 0.
|
|
2951 |
*/
|
|
2952 |
|
|
2953 |
/*!
|
|
2954 |
\variable QStyleOptionSlider::tickPosition
|
|
2955 |
\brief the position of the slider's tick marks, if any
|
|
2956 |
|
|
2957 |
The default value is QSlider::NoTicks.
|
|
2958 |
|
|
2959 |
\sa QSlider::TickPosition
|
|
2960 |
*/
|
|
2961 |
|
|
2962 |
/*!
|
|
2963 |
\variable QStyleOptionSlider::tickInterval
|
|
2964 |
\brief the interval that should be drawn between tick marks
|
|
2965 |
|
|
2966 |
The default value is 0.
|
|
2967 |
*/
|
|
2968 |
|
|
2969 |
/*!
|
|
2970 |
\variable QStyleOptionSlider::notchTarget
|
|
2971 |
\brief the number of pixel between notches
|
|
2972 |
|
|
2973 |
The default value is 0.0.
|
|
2974 |
|
|
2975 |
\sa QDial::notchTarget()
|
|
2976 |
*/
|
|
2977 |
|
|
2978 |
/*!
|
|
2979 |
\variable QStyleOptionSlider::dialWrapping
|
|
2980 |
\brief whether the dial should wrap or not
|
|
2981 |
|
|
2982 |
The default value is false, i.e. the dial is not wrapped.
|
|
2983 |
|
|
2984 |
\sa QDial::wrapping()
|
|
2985 |
*/
|
|
2986 |
|
|
2987 |
/*!
|
|
2988 |
\variable QStyleOptionSlider::upsideDown
|
|
2989 |
\brief the slider control orientation
|
|
2990 |
|
|
2991 |
Normally a slider increases as it moves up or to the right;
|
|
2992 |
upsideDown indicates that it should do the opposite (increase as
|
|
2993 |
it moves down or to the left). The default value is false,
|
|
2994 |
i.e. the slider increases as it moves up or to the right.
|
|
2995 |
|
|
2996 |
\sa QStyle::sliderPositionFromValue(),
|
|
2997 |
QStyle::sliderValueFromPosition(),
|
|
2998 |
QAbstractSlider::invertedAppearance
|
|
2999 |
*/
|
|
3000 |
|
|
3001 |
/*!
|
|
3002 |
\variable QStyleOptionSlider::sliderPosition
|
|
3003 |
\brief the position of the slider handle
|
|
3004 |
|
|
3005 |
If the slider has active feedback (i.e.,
|
|
3006 |
QAbstractSlider::tracking is true), this value will be the same as
|
|
3007 |
\l sliderValue. Otherwise, it will have the current position of
|
|
3008 |
the handle. The default value is 0.
|
|
3009 |
|
|
3010 |
\sa QAbstractSlider::tracking, sliderValue
|
|
3011 |
*/
|
|
3012 |
|
|
3013 |
/*!
|
|
3014 |
\variable QStyleOptionSlider::sliderValue
|
|
3015 |
\brief the value of the slider
|
|
3016 |
|
|
3017 |
If the slider has active feedback (i.e.,
|
|
3018 |
QAbstractSlider::tracking is true), this value will be the same
|
|
3019 |
as \l sliderPosition. Otherwise, it will have the value the
|
|
3020 |
slider had before the mouse was pressed.
|
|
3021 |
|
|
3022 |
The default value is 0.
|
|
3023 |
|
|
3024 |
\sa QAbstractSlider::tracking sliderPosition
|
|
3025 |
*/
|
|
3026 |
|
|
3027 |
/*!
|
|
3028 |
\variable QStyleOptionSlider::singleStep
|
|
3029 |
\brief the size of the single step of the slider
|
|
3030 |
|
|
3031 |
The default value is 0.
|
|
3032 |
|
|
3033 |
\sa QAbstractSlider::singleStep
|
|
3034 |
*/
|
|
3035 |
|
|
3036 |
/*!
|
|
3037 |
\variable QStyleOptionSlider::pageStep
|
|
3038 |
\brief the size of the page step of the slider
|
|
3039 |
|
|
3040 |
The default value is 0.
|
|
3041 |
|
|
3042 |
\sa QAbstractSlider::pageStep
|
|
3043 |
*/
|
|
3044 |
#endif // QT_NO_SLIDER
|
|
3045 |
|
|
3046 |
#ifndef QT_NO_SPINBOX
|
|
3047 |
/*!
|
|
3048 |
\class QStyleOptionSpinBox
|
|
3049 |
\brief The QStyleOptionSpinBox class is used to describe the
|
|
3050 |
parameters necessary for drawing a spin box.
|
|
3051 |
|
|
3052 |
QStyleOptionSpinBox contains all the information that QStyle
|
|
3053 |
functions need to draw QSpinBox and QDateTimeEdit.
|
|
3054 |
|
|
3055 |
For performance reasons, the access to the member variables is
|
|
3056 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3057 |
makes the structures straightforward to use and emphasizes that
|
|
3058 |
these are simply parameters used by the style functions.
|
|
3059 |
|
|
3060 |
For an example demonstrating how style options can be used, see
|
|
3061 |
the \l {widgets/styles}{Styles} example.
|
|
3062 |
|
|
3063 |
\sa QStyleOption, QStyleOptionComplex
|
|
3064 |
*/
|
|
3065 |
|
|
3066 |
/*!
|
|
3067 |
Constructs a QStyleOptionSpinBox, initializing the members
|
|
3068 |
variables to their default values.
|
|
3069 |
*/
|
|
3070 |
|
|
3071 |
QStyleOptionSpinBox::QStyleOptionSpinBox()
|
|
3072 |
: QStyleOptionComplex(Version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
|
|
3073 |
stepEnabled(QAbstractSpinBox::StepNone), frame(false)
|
|
3074 |
{
|
|
3075 |
}
|
|
3076 |
|
|
3077 |
/*!
|
|
3078 |
\internal
|
|
3079 |
*/
|
|
3080 |
QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
|
|
3081 |
: QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
|
|
3082 |
stepEnabled(QAbstractSpinBox::StepNone), frame(false)
|
|
3083 |
{
|
|
3084 |
}
|
|
3085 |
|
|
3086 |
/*!
|
|
3087 |
\fn QStyleOptionSpinBox::QStyleOptionSpinBox(const QStyleOptionSpinBox &other)
|
|
3088 |
|
|
3089 |
Constructs a copy of the \a other style option.
|
|
3090 |
*/
|
|
3091 |
|
|
3092 |
/*!
|
|
3093 |
\enum QStyleOptionSpinBox::StyleOptionType
|
|
3094 |
|
|
3095 |
This enum is used to hold information about the type of the style option, and
|
|
3096 |
is defined for each QStyleOption subclass.
|
|
3097 |
|
|
3098 |
\value Type The type of style option provided (\l{SO_SpinBox} for this class).
|
|
3099 |
|
|
3100 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3101 |
qstyleoption_cast() to determine the type of style option. In
|
|
3102 |
general you do not need to worry about this unless you want to
|
|
3103 |
create your own QStyleOption subclass and your own styles.
|
|
3104 |
|
|
3105 |
\sa StyleOptionVersion
|
|
3106 |
*/
|
|
3107 |
|
|
3108 |
/*!
|
|
3109 |
\enum QStyleOptionSpinBox::StyleOptionVersion
|
|
3110 |
|
|
3111 |
This enum is used to hold information about the version of the style option, and
|
|
3112 |
is defined for each QStyleOption subclass.
|
|
3113 |
|
|
3114 |
\value Version 1
|
|
3115 |
|
|
3116 |
The version is used by QStyleOption subclasses to implement
|
|
3117 |
extensions without breaking compatibility. If you use
|
|
3118 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3119 |
|
|
3120 |
\sa StyleOptionType
|
|
3121 |
*/
|
|
3122 |
|
|
3123 |
/*!
|
|
3124 |
\variable QStyleOptionSpinBox::buttonSymbols
|
|
3125 |
\brief the type of button symbols to draw for the spin box
|
|
3126 |
|
|
3127 |
The default value is QAbstractSpinBox::UpDownArrows specufying
|
|
3128 |
little arrows in the classic style.
|
|
3129 |
|
|
3130 |
\sa QAbstractSpinBox::ButtonSymbols
|
|
3131 |
*/
|
|
3132 |
|
|
3133 |
/*!
|
|
3134 |
\variable QStyleOptionSpinBox::stepEnabled
|
|
3135 |
\brief which buttons of the spin box that are enabled
|
|
3136 |
|
|
3137 |
The default value is QAbstractSpinBox::StepNone.
|
|
3138 |
|
|
3139 |
\sa QAbstractSpinBox::StepEnabled
|
|
3140 |
*/
|
|
3141 |
|
|
3142 |
/*!
|
|
3143 |
\variable QStyleOptionSpinBox::frame
|
|
3144 |
\brief whether the spin box has a frame
|
|
3145 |
|
|
3146 |
The default value is false, i.e. the spin box has no frame.
|
|
3147 |
*/
|
|
3148 |
#endif // QT_NO_SPINBOX
|
|
3149 |
|
|
3150 |
/*!
|
|
3151 |
\class QStyleOptionQ3ListViewItem
|
|
3152 |
\brief The QStyleOptionQ3ListViewItem class is used to describe an
|
|
3153 |
item drawn in a Q3ListView.
|
|
3154 |
|
|
3155 |
This class is used for drawing the compatibility Q3ListView's
|
|
3156 |
items. \bold {It is not recommended for new classes}.
|
|
3157 |
|
|
3158 |
QStyleOptionQ3ListViewItem contains all the information that
|
|
3159 |
QStyle functions need to draw the Q3ListView items.
|
|
3160 |
|
|
3161 |
For performance reasons, the access to the member variables is
|
|
3162 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3163 |
makes the structures straightforward to use and emphasizes that
|
|
3164 |
these are simply parameters used by the style functions.
|
|
3165 |
|
|
3166 |
For an example demonstrating how style options can be used, see
|
|
3167 |
the \l {widgets/styles}{Styles} example.
|
|
3168 |
|
|
3169 |
\sa QStyleOption, QStyleOptionQ3ListView, Q3ListViewItem
|
|
3170 |
*/
|
|
3171 |
|
|
3172 |
/*!
|
|
3173 |
\enum QStyleOptionQ3ListViewItem::Q3ListViewItemFeature
|
|
3174 |
|
|
3175 |
This enum describes the features a list view item can have.
|
|
3176 |
|
|
3177 |
\value None A standard item.
|
|
3178 |
\value Expandable The item has children that can be shown.
|
|
3179 |
\value MultiLine The item is more than one line tall.
|
|
3180 |
\value Visible The item is visible.
|
|
3181 |
\value ParentControl The item's parent is a type of item control (Q3CheckListItem::Controller).
|
|
3182 |
|
|
3183 |
\sa features, Q3ListViewItem::isVisible(), Q3ListViewItem::multiLinesEnabled(),
|
|
3184 |
Q3ListViewItem::isExpandable()
|
|
3185 |
*/
|
|
3186 |
|
|
3187 |
/*!
|
|
3188 |
Constructs a QStyleOptionQ3ListViewItem, initializing the members
|
|
3189 |
variables to their default values.
|
|
3190 |
*/
|
|
3191 |
|
|
3192 |
QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem()
|
|
3193 |
: QStyleOption(Version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
|
|
3194 |
itemY(0), childCount(0)
|
|
3195 |
{
|
|
3196 |
}
|
|
3197 |
|
|
3198 |
/*!
|
|
3199 |
\internal
|
|
3200 |
*/
|
|
3201 |
QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(int version)
|
|
3202 |
: QStyleOption(version, SO_Q3ListViewItem), features(None), height(0), totalHeight(0),
|
|
3203 |
itemY(0), childCount(0)
|
|
3204 |
{
|
|
3205 |
}
|
|
3206 |
|
|
3207 |
/*!
|
|
3208 |
\fn QStyleOptionQ3ListViewItem::QStyleOptionQ3ListViewItem(const QStyleOptionQ3ListViewItem &other)
|
|
3209 |
|
|
3210 |
Constructs a copy of the \a other style option.
|
|
3211 |
*/
|
|
3212 |
|
|
3213 |
/*!
|
|
3214 |
\enum QStyleOptionQ3ListViewItem::StyleOptionType
|
|
3215 |
|
|
3216 |
This enum is used to hold information about the type of the style option, and
|
|
3217 |
is defined for each QStyleOption subclass.
|
|
3218 |
|
|
3219 |
\value Type The type of style option provided (\l{SO_Q3ListViewItem} for this class).
|
|
3220 |
|
|
3221 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3222 |
qstyleoption_cast() to determine the type of style option. In
|
|
3223 |
general you do not need to worry about this unless you want to
|
|
3224 |
create your own QStyleOption subclass and your own styles.
|
|
3225 |
|
|
3226 |
\sa StyleOptionVersion
|
|
3227 |
*/
|
|
3228 |
|
|
3229 |
/*!
|
|
3230 |
\enum QStyleOptionQ3ListViewItem::StyleOptionVersion
|
|
3231 |
|
|
3232 |
This enum is used to hold information about the version of the style option, and
|
|
3233 |
is defined for each QStyleOption subclass.
|
|
3234 |
|
|
3235 |
\value Version 1
|
|
3236 |
|
|
3237 |
The version is used by QStyleOption subclasses to implement
|
|
3238 |
extensions without breaking compatibility. If you use
|
|
3239 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3240 |
|
|
3241 |
\sa StyleOptionType
|
|
3242 |
*/
|
|
3243 |
|
|
3244 |
/*!
|
|
3245 |
\variable QStyleOptionQ3ListViewItem::features
|
|
3246 |
\brief the features for this item
|
|
3247 |
|
|
3248 |
This variable is a bitwise OR of the features of the item. The deafult value is \l None.
|
|
3249 |
|
|
3250 |
\sa Q3ListViewItemFeature
|
|
3251 |
*/
|
|
3252 |
|
|
3253 |
/*!
|
|
3254 |
\variable QStyleOptionQ3ListViewItem::height
|
|
3255 |
\brief the height of the item
|
|
3256 |
|
|
3257 |
This doesn't include the height of the item's children. The default height is 0.
|
|
3258 |
|
|
3259 |
\sa Q3ListViewItem::height()
|
|
3260 |
*/
|
|
3261 |
|
|
3262 |
/*!
|
|
3263 |
\variable QStyleOptionQ3ListViewItem::totalHeight
|
|
3264 |
\brief the total height of the item, including its children
|
|
3265 |
|
|
3266 |
The default total height is 0.
|
|
3267 |
|
|
3268 |
\sa Q3ListViewItem::totalHeight()
|
|
3269 |
*/
|
|
3270 |
|
|
3271 |
/*!
|
|
3272 |
\variable QStyleOptionQ3ListViewItem::itemY
|
|
3273 |
\brief the Y-coordinate for the item
|
|
3274 |
|
|
3275 |
The default value is 0.
|
|
3276 |
|
|
3277 |
\sa Q3ListViewItem::itemPos()
|
|
3278 |
*/
|
|
3279 |
|
|
3280 |
/*!
|
|
3281 |
\variable QStyleOptionQ3ListViewItem::childCount
|
|
3282 |
\brief the number of children the item has
|
|
3283 |
*/
|
|
3284 |
|
|
3285 |
/*!
|
|
3286 |
\class QStyleOptionQ3ListView
|
|
3287 |
\brief The QStyleOptionQ3ListView class is used to describe the
|
|
3288 |
parameters for drawing a Q3ListView.
|
|
3289 |
|
|
3290 |
This class is used for drawing the compatibility Q3ListView. \bold
|
|
3291 |
{It is not recommended for new classes}.
|
|
3292 |
|
|
3293 |
QStyleOptionQ3ListView contains all the information that QStyle
|
|
3294 |
functions need to draw Q3ListView.
|
|
3295 |
|
|
3296 |
For performance reasons, the access to the member variables is
|
|
3297 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3298 |
makes the structures straightforward to use and emphasizes that
|
|
3299 |
these are simply parameters used by the style functions.
|
|
3300 |
|
|
3301 |
For an example demonstrating how style options can be used, see
|
|
3302 |
the \l {widgets/styles}{Styles} example.
|
|
3303 |
|
|
3304 |
\sa QStyleOptionComplex, Q3ListView, QStyleOptionQ3ListViewItem
|
|
3305 |
*/
|
|
3306 |
|
|
3307 |
/*!
|
|
3308 |
Creates a QStyleOptionQ3ListView, initializing the members
|
|
3309 |
variables to their default values.
|
|
3310 |
*/
|
|
3311 |
|
|
3312 |
QStyleOptionQ3ListView::QStyleOptionQ3ListView()
|
|
3313 |
: QStyleOptionComplex(Version, SO_Q3ListView), viewportBGRole(QPalette::Base),
|
|
3314 |
sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false)
|
|
3315 |
{
|
|
3316 |
}
|
|
3317 |
|
|
3318 |
/*!
|
|
3319 |
\internal
|
|
3320 |
*/
|
|
3321 |
QStyleOptionQ3ListView::QStyleOptionQ3ListView(int version)
|
|
3322 |
: QStyleOptionComplex(version, SO_Q3ListView), viewportBGRole(QPalette::Base),
|
|
3323 |
sortColumn(0), itemMargin(0), treeStepSize(0), rootIsDecorated(false)
|
|
3324 |
{
|
|
3325 |
}
|
|
3326 |
|
|
3327 |
/*!
|
|
3328 |
\fn QStyleOptionQ3ListView::QStyleOptionQ3ListView(const QStyleOptionQ3ListView &other)
|
|
3329 |
|
|
3330 |
Constructs a copy of the \a other style option.
|
|
3331 |
*/
|
|
3332 |
|
|
3333 |
/*!
|
|
3334 |
\enum QStyleOptionQ3ListView::StyleOptionType
|
|
3335 |
|
|
3336 |
This enum is used to hold information about the type of the style option, and
|
|
3337 |
is defined for each QStyleOption subclass.
|
|
3338 |
|
|
3339 |
\value Type The type of style option provided (\l{SO_Q3ListView} for this class).
|
|
3340 |
|
|
3341 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3342 |
qstyleoption_cast() to determine the type of style option. In
|
|
3343 |
general you do not need to worry about this unless you want to
|
|
3344 |
create your own QStyleOption subclass and your own styles.
|
|
3345 |
|
|
3346 |
\sa StyleOptionVersion
|
|
3347 |
*/
|
|
3348 |
|
|
3349 |
/*!
|
|
3350 |
\enum QStyleOptionQ3ListView::StyleOptionVersion
|
|
3351 |
|
|
3352 |
This enum is used to hold information about the version of the style option, and
|
|
3353 |
is defined for each QStyleOption subclass.
|
|
3354 |
|
|
3355 |
\value Version 1
|
|
3356 |
|
|
3357 |
The version is used by QStyleOption subclasses to implement
|
|
3358 |
extensions without breaking compatibility. If you use
|
|
3359 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3360 |
|
|
3361 |
\sa StyleOptionType
|
|
3362 |
*/
|
|
3363 |
|
|
3364 |
/*!
|
|
3365 |
\variable QStyleOptionQ3ListView::items
|
|
3366 |
\brief a list of items in the Q3ListView
|
|
3367 |
|
|
3368 |
This is a list of \l {QStyleOptionQ3ListViewItem}s. The first item
|
|
3369 |
can be used for most of the calculation that are needed for
|
|
3370 |
drawing a list view. Any additional items are the children of
|
|
3371 |
this first item, which may be used for additional information.
|
|
3372 |
|
|
3373 |
\sa QStyleOptionQ3ListViewItem
|
|
3374 |
*/
|
|
3375 |
|
|
3376 |
/*!
|
|
3377 |
\variable QStyleOptionQ3ListView::viewportPalette
|
|
3378 |
\brief the palette of Q3ListView's viewport
|
|
3379 |
|
|
3380 |
By default, the application's default palette is used.
|
|
3381 |
*/
|
|
3382 |
|
|
3383 |
/*!
|
|
3384 |
\variable QStyleOptionQ3ListView::viewportBGRole
|
|
3385 |
\brief the background role of Q3ListView's viewport
|
|
3386 |
|
|
3387 |
The default value is QPalette::Base.
|
|
3388 |
|
|
3389 |
\sa QWidget::backgroundRole()
|
|
3390 |
*/
|
|
3391 |
|
|
3392 |
/*!
|
|
3393 |
\variable QStyleOptionQ3ListView::sortColumn
|
|
3394 |
\brief the sort column of the list view
|
|
3395 |
|
|
3396 |
The default value is 0.
|
|
3397 |
|
|
3398 |
\sa Q3ListView::sortColumn()
|
|
3399 |
*/
|
|
3400 |
|
|
3401 |
/*!
|
|
3402 |
\variable QStyleOptionQ3ListView::itemMargin
|
|
3403 |
\brief the margin for items in the list view
|
|
3404 |
|
|
3405 |
The default value is 0.
|
|
3406 |
|
|
3407 |
\sa Q3ListView::itemMargin()
|
|
3408 |
*/
|
|
3409 |
|
|
3410 |
/*!
|
|
3411 |
\variable QStyleOptionQ3ListView::treeStepSize
|
|
3412 |
\brief the number of pixel to offset children items from their
|
|
3413 |
parents
|
|
3414 |
|
|
3415 |
The default value is 0.
|
|
3416 |
|
|
3417 |
\sa Q3ListView::treeStepSize()
|
|
3418 |
*/
|
|
3419 |
|
|
3420 |
/*!
|
|
3421 |
\variable QStyleOptionQ3ListView::rootIsDecorated
|
|
3422 |
\brief whether root items are decorated
|
|
3423 |
|
|
3424 |
The default value is false.
|
|
3425 |
|
|
3426 |
\sa Q3ListView::rootIsDecorated()
|
|
3427 |
*/
|
|
3428 |
|
|
3429 |
/*!
|
|
3430 |
\class QStyleOptionQ3DockWindow
|
|
3431 |
\brief The QStyleOptionQ3DockWindow class is used to describe the
|
|
3432 |
parameters for drawing various parts of a Q3DockWindow.
|
|
3433 |
|
|
3434 |
This class is used for drawing the old Q3DockWindow and its
|
|
3435 |
parts. \bold {It is not recommended for new classes}.
|
|
3436 |
|
|
3437 |
QStyleOptionQ3DockWindow contains all the information that QStyle
|
|
3438 |
functions need to draw Q3DockWindow and its parts.
|
|
3439 |
|
|
3440 |
For performance reasons, the access to the member variables is
|
|
3441 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3442 |
makes the structures straightforward to use and emphasizes that
|
|
3443 |
these are simply parameters used by the style functions.
|
|
3444 |
|
|
3445 |
For an example demonstrating how style options can be used, see
|
|
3446 |
the \l {widgets/styles}{Styles} example.
|
|
3447 |
|
|
3448 |
\sa QStyleOption, Q3DockWindow
|
|
3449 |
*/
|
|
3450 |
|
|
3451 |
/*!
|
|
3452 |
Constructs a QStyleOptionQ3DockWindow, initializing the member
|
|
3453 |
variables to their default values.
|
|
3454 |
*/
|
|
3455 |
|
|
3456 |
QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow()
|
|
3457 |
: QStyleOption(Version, SO_Q3DockWindow), docked(false), closeEnabled(false)
|
|
3458 |
{
|
|
3459 |
}
|
|
3460 |
|
|
3461 |
/*!
|
|
3462 |
\internal
|
|
3463 |
*/
|
|
3464 |
QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(int version)
|
|
3465 |
: QStyleOption(version, SO_Q3DockWindow), docked(false), closeEnabled(false)
|
|
3466 |
{
|
|
3467 |
}
|
|
3468 |
|
|
3469 |
/*!
|
|
3470 |
\fn QStyleOptionQ3DockWindow::QStyleOptionQ3DockWindow(const QStyleOptionQ3DockWindow &other)
|
|
3471 |
|
|
3472 |
Constructs a copy of the \a other style option.
|
|
3473 |
*/
|
|
3474 |
|
|
3475 |
/*!
|
|
3476 |
\enum QStyleOptionQ3DockWindow::StyleOptionType
|
|
3477 |
|
|
3478 |
This enum is used to hold information about the type of the style option, and
|
|
3479 |
is defined for each QStyleOption subclass.
|
|
3480 |
|
|
3481 |
\value Type The type of style option provided (\l{SO_Q3DockWindow} for this class).
|
|
3482 |
|
|
3483 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3484 |
qstyleoption_cast() to determine the type of style option. In
|
|
3485 |
general you do not need to worry about this unless you want to
|
|
3486 |
create your own QStyleOption subclass and your own styles.
|
|
3487 |
|
|
3488 |
\sa StyleOptionVersion
|
|
3489 |
*/
|
|
3490 |
|
|
3491 |
/*!
|
|
3492 |
\enum QStyleOptionQ3DockWindow::StyleOptionVersion
|
|
3493 |
|
|
3494 |
This enum is used to hold information about the version of the style option, and
|
|
3495 |
is defined for each QStyleOption subclass.
|
|
3496 |
|
|
3497 |
\value Version 1
|
|
3498 |
|
|
3499 |
The version is used by QStyleOption subclasses to implement
|
|
3500 |
extensions without breaking compatibility. If you use
|
|
3501 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3502 |
|
|
3503 |
\sa StyleOptionType
|
|
3504 |
*/
|
|
3505 |
|
|
3506 |
/*!
|
|
3507 |
\variable QStyleOptionQ3DockWindow::docked
|
|
3508 |
\brief whether the dock window is currently docked
|
|
3509 |
|
|
3510 |
The default value is false.
|
|
3511 |
*/
|
|
3512 |
|
|
3513 |
/*!
|
|
3514 |
\variable QStyleOptionQ3DockWindow::closeEnabled
|
|
3515 |
\brief whether the dock window has a close button
|
|
3516 |
|
|
3517 |
The default value is false.
|
|
3518 |
*/
|
|
3519 |
|
|
3520 |
/*!
|
|
3521 |
\class QStyleOptionDockWidget
|
|
3522 |
\brief The QStyleOptionDockWidget class is used to describe the
|
|
3523 |
parameters for drawing a dock widget.
|
|
3524 |
|
|
3525 |
QStyleOptionDockWidget contains all the information that QStyle
|
|
3526 |
functions need to draw graphical elements like QDockWidget.
|
|
3527 |
|
|
3528 |
For performance reasons, the access to the member variables is
|
|
3529 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3530 |
makes the structures straightforward to use and emphasizes that
|
|
3531 |
these are simply parameters used by the style functions.
|
|
3532 |
|
|
3533 |
For an example demonstrating how style options can be used, see
|
|
3534 |
the \l {widgets/styles}{Styles} example.
|
|
3535 |
|
|
3536 |
\sa QStyleOption
|
|
3537 |
*/
|
|
3538 |
|
|
3539 |
/*!
|
|
3540 |
Constructs a QStyleOptionDockWidget, initializing the member
|
|
3541 |
variables to their default values.
|
|
3542 |
*/
|
|
3543 |
|
|
3544 |
QStyleOptionDockWidget::QStyleOptionDockWidget()
|
|
3545 |
: QStyleOption(Version, SO_DockWidget), closable(false),
|
|
3546 |
movable(false), floatable(false)
|
|
3547 |
{
|
|
3548 |
}
|
|
3549 |
|
|
3550 |
/*!
|
|
3551 |
\internal
|
|
3552 |
*/
|
|
3553 |
QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
|
|
3554 |
: QStyleOption(version, SO_DockWidget), closable(false),
|
|
3555 |
movable(false), floatable(false)
|
|
3556 |
{
|
|
3557 |
}
|
|
3558 |
|
|
3559 |
QStyleOptionDockWidgetV2::QStyleOptionDockWidgetV2()
|
|
3560 |
: QStyleOptionDockWidget(Version), verticalTitleBar(false)
|
|
3561 |
{
|
|
3562 |
}
|
|
3563 |
|
|
3564 |
QStyleOptionDockWidgetV2::QStyleOptionDockWidgetV2(
|
|
3565 |
const QStyleOptionDockWidget &other)
|
|
3566 |
: QStyleOptionDockWidget(Version)
|
|
3567 |
{
|
|
3568 |
(void)QStyleOptionDockWidgetV2::operator=(other);
|
|
3569 |
}
|
|
3570 |
|
|
3571 |
QStyleOptionDockWidgetV2 &QStyleOptionDockWidgetV2::operator = (
|
|
3572 |
const QStyleOptionDockWidget &other)
|
|
3573 |
{
|
|
3574 |
QStyleOptionDockWidget::operator=(other);
|
|
3575 |
const QStyleOptionDockWidgetV2 *v2
|
|
3576 |
= qstyleoption_cast<const QStyleOptionDockWidgetV2*>(&other);
|
|
3577 |
verticalTitleBar = v2 ? v2->verticalTitleBar : false;
|
|
3578 |
return *this;
|
|
3579 |
}
|
|
3580 |
|
|
3581 |
QStyleOptionDockWidgetV2::QStyleOptionDockWidgetV2(int version)
|
|
3582 |
: QStyleOptionDockWidget(version), verticalTitleBar(false)
|
|
3583 |
{
|
|
3584 |
}
|
|
3585 |
|
|
3586 |
/*!
|
|
3587 |
\fn QStyleOptionDockWidget::QStyleOptionDockWidget(const QStyleOptionDockWidget &other)
|
|
3588 |
|
|
3589 |
Constructs a copy of the \a other style option.
|
|
3590 |
*/
|
|
3591 |
|
|
3592 |
/*!
|
|
3593 |
\enum QStyleOptionDockWidget::StyleOptionType
|
|
3594 |
|
|
3595 |
This enum is used to hold information about the type of the style option, and
|
|
3596 |
is defined for each QStyleOption subclass.
|
|
3597 |
|
|
3598 |
\value Type The type of style option provided (\l{SO_DockWidget} for this class).
|
|
3599 |
|
|
3600 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3601 |
qstyleoption_cast() to determine the type of style option. In
|
|
3602 |
general you do not need to worry about this unless you want to
|
|
3603 |
create your own QStyleOption subclass and your own styles.
|
|
3604 |
|
|
3605 |
\sa StyleOptionVersion
|
|
3606 |
*/
|
|
3607 |
|
|
3608 |
/*!
|
|
3609 |
\enum QStyleOptionDockWidget::StyleOptionVersion
|
|
3610 |
|
|
3611 |
This enum is used to hold information about the version of the style option, and
|
|
3612 |
is defined for each QStyleOption subclass.
|
|
3613 |
|
|
3614 |
\value Version 1
|
|
3615 |
|
|
3616 |
The version is used by QStyleOption subclasses to implement
|
|
3617 |
extensions without breaking compatibility. If you use
|
|
3618 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3619 |
|
|
3620 |
\sa StyleOptionType
|
|
3621 |
*/
|
|
3622 |
|
|
3623 |
/*!
|
|
3624 |
\variable QStyleOptionDockWidget::title
|
|
3625 |
\brief the title of the dock window
|
|
3626 |
|
|
3627 |
The default value is an empty string.
|
|
3628 |
*/
|
|
3629 |
|
|
3630 |
/*!
|
|
3631 |
\variable QStyleOptionDockWidget::closable
|
|
3632 |
\brief whether the dock window is closable
|
|
3633 |
|
|
3634 |
The default value is true.
|
|
3635 |
*/
|
|
3636 |
|
|
3637 |
/*!
|
|
3638 |
\variable QStyleOptionDockWidget::movable
|
|
3639 |
\brief whether the dock window is movable
|
|
3640 |
|
|
3641 |
The default value is false.
|
|
3642 |
*/
|
|
3643 |
|
|
3644 |
/*!
|
|
3645 |
\variable QStyleOptionDockWidget::floatable
|
|
3646 |
\brief whether the dock window is floatable
|
|
3647 |
|
|
3648 |
The default value is true.
|
|
3649 |
*/
|
|
3650 |
|
|
3651 |
/*!
|
|
3652 |
\class QStyleOptionToolButton
|
|
3653 |
\brief The QStyleOptionToolButton class is used to describe the
|
|
3654 |
parameters for drawing a tool button.
|
|
3655 |
|
|
3656 |
QStyleOptionToolButton contains all the information that QStyle
|
|
3657 |
functions need to draw QToolButton.
|
|
3658 |
|
|
3659 |
For performance reasons, the access to the member variables is
|
|
3660 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3661 |
makes the structures straightforward to use and emphasizes that
|
|
3662 |
these are simply parameters used by the style functions.
|
|
3663 |
|
|
3664 |
For an example demonstrating how style options can be used, see
|
|
3665 |
the \l {widgets/styles}{Styles} example.
|
|
3666 |
|
|
3667 |
\sa QStyleOption, QStyleOptionComplex, QStyleOptionButton
|
|
3668 |
*/
|
|
3669 |
|
|
3670 |
/*!
|
|
3671 |
\enum QStyleOptionToolButton::ToolButtonFeature
|
|
3672 |
Describes the various features that a tool button can have.
|
|
3673 |
|
|
3674 |
\value None A normal tool button.
|
|
3675 |
\value Arrow The tool button is an arrow.
|
|
3676 |
\value Menu The tool button has a menu.
|
|
3677 |
\value PopupDelay There is a delay to showing the menu.
|
|
3678 |
\value HasMenu The button has a popup menu.
|
|
3679 |
\value MenuButtonPopup The button should display an arrow to
|
|
3680 |
indicate that a menu is present.
|
|
3681 |
|
|
3682 |
\sa features, QToolButton::toolButtonStyle(), QToolButton::popupMode()
|
|
3683 |
*/
|
|
3684 |
|
|
3685 |
/*!
|
|
3686 |
Constructs a QStyleOptionToolButton, initializing the members
|
|
3687 |
variables to their default values.
|
|
3688 |
*/
|
|
3689 |
|
|
3690 |
QStyleOptionToolButton::QStyleOptionToolButton()
|
|
3691 |
: QStyleOptionComplex(Version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
|
|
3692 |
, toolButtonStyle(Qt::ToolButtonIconOnly)
|
|
3693 |
{
|
|
3694 |
}
|
|
3695 |
|
|
3696 |
/*!
|
|
3697 |
\internal
|
|
3698 |
*/
|
|
3699 |
QStyleOptionToolButton::QStyleOptionToolButton(int version)
|
|
3700 |
: QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
|
|
3701 |
, toolButtonStyle(Qt::ToolButtonIconOnly)
|
|
3702 |
|
|
3703 |
{
|
|
3704 |
}
|
|
3705 |
|
|
3706 |
/*!
|
|
3707 |
\fn QStyleOptionToolButton::QStyleOptionToolButton(const QStyleOptionToolButton &other)
|
|
3708 |
|
|
3709 |
Constructs a copy of the \a other style option.
|
|
3710 |
*/
|
|
3711 |
|
|
3712 |
/*!
|
|
3713 |
\enum QStyleOptionToolButton::StyleOptionType
|
|
3714 |
|
|
3715 |
This enum is used to hold information about the type of the style option, and
|
|
3716 |
is defined for each QStyleOption subclass.
|
|
3717 |
|
|
3718 |
\value Type The type of style option provided (\l{SO_ToolButton} for this class).
|
|
3719 |
|
|
3720 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3721 |
qstyleoption_cast() to determine the type of style option. In
|
|
3722 |
general you do not need to worry about this unless you want to
|
|
3723 |
create your own QStyleOption subclass and your own styles.
|
|
3724 |
|
|
3725 |
\sa StyleOptionVersion
|
|
3726 |
*/
|
|
3727 |
|
|
3728 |
/*!
|
|
3729 |
\enum QStyleOptionToolButton::StyleOptionVersion
|
|
3730 |
|
|
3731 |
This enum is used to hold information about the version of the style option, and
|
|
3732 |
is defined for each QStyleOption subclass.
|
|
3733 |
|
|
3734 |
\value Version 1
|
|
3735 |
|
|
3736 |
The version is used by QStyleOption subclasses to implement
|
|
3737 |
extensions without breaking compatibility. If you use
|
|
3738 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3739 |
|
|
3740 |
\sa StyleOptionType
|
|
3741 |
*/
|
|
3742 |
|
|
3743 |
/*!
|
|
3744 |
\variable QStyleOptionToolButton::features
|
|
3745 |
\brief an OR combination of the tool button's features
|
|
3746 |
|
|
3747 |
The default value is \l None.
|
|
3748 |
|
|
3749 |
\sa ToolButtonFeature
|
|
3750 |
*/
|
|
3751 |
|
|
3752 |
/*!
|
|
3753 |
\variable QStyleOptionToolButton::icon
|
|
3754 |
\brief the icon for the tool button
|
|
3755 |
|
|
3756 |
The default value is an empty icon, i.e. an icon with neither a
|
|
3757 |
pixmap nor a filename.
|
|
3758 |
|
|
3759 |
\sa iconSize
|
|
3760 |
*/
|
|
3761 |
|
|
3762 |
/*!
|
|
3763 |
\variable QStyleOptionToolButton::iconSize
|
|
3764 |
\brief the size of the icon for the tool button
|
|
3765 |
|
|
3766 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
3767 |
*/
|
|
3768 |
|
|
3769 |
/*!
|
|
3770 |
\variable QStyleOptionToolButton::text
|
|
3771 |
\brief the text of the tool button
|
|
3772 |
|
|
3773 |
This value is only used if toolButtonStyle is
|
|
3774 |
Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
|
|
3775 |
Qt::ToolButtonTextOnly. The default value is an empty string.
|
|
3776 |
*/
|
|
3777 |
|
|
3778 |
/*!
|
|
3779 |
\variable QStyleOptionToolButton::arrowType
|
|
3780 |
\brief the direction of the arrow for the tool button
|
|
3781 |
|
|
3782 |
This value is only used if \l features includes \l Arrow. The
|
|
3783 |
default value is Qt::DownArrow.
|
|
3784 |
*/
|
|
3785 |
|
|
3786 |
/*!
|
|
3787 |
\variable QStyleOptionToolButton::toolButtonStyle
|
|
3788 |
\brief a Qt::ToolButtonStyle value describing the appearance of
|
|
3789 |
the tool button
|
|
3790 |
|
|
3791 |
The default value is Qt::ToolButtonIconOnly.
|
|
3792 |
|
|
3793 |
\sa QToolButton::toolButtonStyle()
|
|
3794 |
*/
|
|
3795 |
|
|
3796 |
/*!
|
|
3797 |
\variable QStyleOptionToolButton::pos
|
|
3798 |
\brief the position of the tool button
|
|
3799 |
|
|
3800 |
The default value is a null point, i.e. (0, 0)
|
|
3801 |
*/
|
|
3802 |
|
|
3803 |
/*!
|
|
3804 |
\variable QStyleOptionToolButton::font
|
|
3805 |
\brief the font that is used for the text
|
|
3806 |
|
|
3807 |
This value is only used if toolButtonStyle is
|
|
3808 |
Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
|
|
3809 |
Qt::ToolButtonTextOnly. By default, the application's default font
|
|
3810 |
is used.
|
|
3811 |
*/
|
|
3812 |
|
|
3813 |
/*!
|
|
3814 |
\class QStyleOptionComboBox
|
|
3815 |
\brief The QStyleOptionComboBox class is used to describe the
|
|
3816 |
parameter for drawing a combobox.
|
|
3817 |
|
|
3818 |
QStyleOptionButton contains all the information that QStyle
|
|
3819 |
functions need to draw QComboBox.
|
|
3820 |
|
|
3821 |
For performance reasons, the access to the member variables is
|
|
3822 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3823 |
makes the structures straightforward to use and emphasizes that
|
|
3824 |
these are simply parameters used by the style functions.
|
|
3825 |
|
|
3826 |
For an example demonstrating how style options can be used, see
|
|
3827 |
the \l {widgets/styles}{Styles} example.
|
|
3828 |
|
|
3829 |
\sa QStyleOption, QStyleOptionComplex, QComboBox
|
|
3830 |
*/
|
|
3831 |
|
|
3832 |
/*!
|
|
3833 |
Creates a QStyleOptionComboBox, initializing the members variables
|
|
3834 |
to their default values.
|
|
3835 |
*/
|
|
3836 |
|
|
3837 |
QStyleOptionComboBox::QStyleOptionComboBox()
|
|
3838 |
: QStyleOptionComplex(Version, SO_ComboBox), editable(false), frame(true)
|
|
3839 |
{
|
|
3840 |
}
|
|
3841 |
|
|
3842 |
/*!
|
|
3843 |
\internal
|
|
3844 |
*/
|
|
3845 |
QStyleOptionComboBox::QStyleOptionComboBox(int version)
|
|
3846 |
: QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true)
|
|
3847 |
{
|
|
3848 |
}
|
|
3849 |
|
|
3850 |
/*!
|
|
3851 |
\fn QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)
|
|
3852 |
|
|
3853 |
Constructs a copy of the \a other style option.
|
|
3854 |
*/
|
|
3855 |
|
|
3856 |
/*!
|
|
3857 |
\enum QStyleOptionComboBox::StyleOptionType
|
|
3858 |
|
|
3859 |
This enum is used to hold information about the type of the style option, and
|
|
3860 |
is defined for each QStyleOption subclass.
|
|
3861 |
|
|
3862 |
\value Type The type of style option provided (\l{SO_ComboBox} for this class).
|
|
3863 |
|
|
3864 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3865 |
qstyleoption_cast() to determine the type of style option. In
|
|
3866 |
general you do not need to worry about this unless you want to
|
|
3867 |
create your own QStyleOption subclass and your own styles.
|
|
3868 |
|
|
3869 |
\sa StyleOptionVersion
|
|
3870 |
*/
|
|
3871 |
|
|
3872 |
/*!
|
|
3873 |
\enum QStyleOptionComboBox::StyleOptionVersion
|
|
3874 |
|
|
3875 |
This enum is used to hold information about the version of the style option, and
|
|
3876 |
is defined for each QStyleOption subclass.
|
|
3877 |
|
|
3878 |
\value Version 1
|
|
3879 |
|
|
3880 |
The version is used by QStyleOption subclasses to implement
|
|
3881 |
extensions without breaking compatibility. If you use
|
|
3882 |
qstyleoption_cast(), you normally do not need to check it.
|
|
3883 |
|
|
3884 |
\sa StyleOptionType
|
|
3885 |
*/
|
|
3886 |
|
|
3887 |
/*!
|
|
3888 |
\variable QStyleOptionComboBox::editable
|
|
3889 |
\brief whether or not the combobox is editable or not
|
|
3890 |
|
|
3891 |
the default
|
|
3892 |
value is false
|
|
3893 |
|
|
3894 |
\sa QComboBox::isEditable()
|
|
3895 |
*/
|
|
3896 |
|
|
3897 |
|
|
3898 |
/*!
|
|
3899 |
\variable QStyleOptionComboBox::frame
|
|
3900 |
\brief whether the combo box has a frame
|
|
3901 |
|
|
3902 |
The default value is true.
|
|
3903 |
*/
|
|
3904 |
|
|
3905 |
/*!
|
|
3906 |
\variable QStyleOptionComboBox::currentText
|
|
3907 |
\brief the text for the current item of the combo box
|
|
3908 |
|
|
3909 |
The default value is an empty string.
|
|
3910 |
*/
|
|
3911 |
|
|
3912 |
/*!
|
|
3913 |
\variable QStyleOptionComboBox::currentIcon
|
|
3914 |
\brief the icon for the current item of the combo box
|
|
3915 |
|
|
3916 |
The default value is an empty icon, i.e. an icon with neither a
|
|
3917 |
pixmap nor a filename.
|
|
3918 |
*/
|
|
3919 |
|
|
3920 |
/*!
|
|
3921 |
\variable QStyleOptionComboBox::iconSize
|
|
3922 |
\brief the icon size for the current item of the combo box
|
|
3923 |
|
|
3924 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
3925 |
*/
|
|
3926 |
|
|
3927 |
/*!
|
|
3928 |
\variable QStyleOptionComboBox::popupRect
|
|
3929 |
\brief the popup rectangle for the combobox
|
|
3930 |
|
|
3931 |
The default value is a null rectangle, i.e. a rectangle with both
|
|
3932 |
the width and the height set to 0.
|
|
3933 |
|
|
3934 |
This variable is currently unused. You can safely ignore it.
|
|
3935 |
|
|
3936 |
\sa QStyle::SC_ComboBoxListBoxPopup
|
|
3937 |
*/
|
|
3938 |
|
|
3939 |
/*!
|
|
3940 |
\class QStyleOptionToolBox
|
|
3941 |
\brief The QStyleOptionToolBox class is used to describe the
|
|
3942 |
parameters needed for drawing a tool box.
|
|
3943 |
|
|
3944 |
QStyleOptionToolBox contains all the information that QStyle
|
|
3945 |
functions need to draw QToolBox.
|
|
3946 |
|
|
3947 |
For performance reasons, the access to the member variables is
|
|
3948 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
3949 |
makes the structures straightforward to use and emphasizes that
|
|
3950 |
these are simply parameters used by the style functions.
|
|
3951 |
|
|
3952 |
For an example demonstrating how style options can be used, see
|
|
3953 |
the \l {widgets/styles}{Styles} example.
|
|
3954 |
|
|
3955 |
\sa QStyleOption, QToolBox
|
|
3956 |
*/
|
|
3957 |
|
|
3958 |
/*!
|
|
3959 |
Creates a QStyleOptionToolBox, initializing the members variables
|
|
3960 |
to their default values.
|
|
3961 |
*/
|
|
3962 |
|
|
3963 |
QStyleOptionToolBox::QStyleOptionToolBox()
|
|
3964 |
: QStyleOption(Version, SO_ToolBox)
|
|
3965 |
{
|
|
3966 |
}
|
|
3967 |
|
|
3968 |
/*!
|
|
3969 |
\internal
|
|
3970 |
*/
|
|
3971 |
QStyleOptionToolBox::QStyleOptionToolBox(int version)
|
|
3972 |
: QStyleOption(version, SO_ToolBox)
|
|
3973 |
{
|
|
3974 |
}
|
|
3975 |
|
|
3976 |
/*!
|
|
3977 |
\fn QStyleOptionToolBox::QStyleOptionToolBox(const QStyleOptionToolBox &other)
|
|
3978 |
|
|
3979 |
Constructs a copy of the \a other style option.
|
|
3980 |
*/
|
|
3981 |
|
|
3982 |
/*!
|
|
3983 |
\enum QStyleOptionToolBox::StyleOptionType
|
|
3984 |
|
|
3985 |
This enum is used to hold information about the type of the style option, and
|
|
3986 |
is defined for each QStyleOption subclass.
|
|
3987 |
|
|
3988 |
\value Type The type of style option provided (\l{SO_ToolBox} for this class).
|
|
3989 |
|
|
3990 |
The type is used internally by QStyleOption, its subclasses, and
|
|
3991 |
qstyleoption_cast() to determine the type of style option. In
|
|
3992 |
general you do not need to worry about this unless you want to
|
|
3993 |
create your own QStyleOption subclass and your own styles.
|
|
3994 |
|
|
3995 |
\sa StyleOptionVersion
|
|
3996 |
*/
|
|
3997 |
|
|
3998 |
/*!
|
|
3999 |
\enum QStyleOptionToolBox::StyleOptionVersion
|
|
4000 |
|
|
4001 |
This enum is used to hold information about the version of the style option, and
|
|
4002 |
is defined for each QStyleOption subclass.
|
|
4003 |
|
|
4004 |
\value Version 1
|
|
4005 |
|
|
4006 |
The version is used by QStyleOption subclasses to implement
|
|
4007 |
extensions without breaking compatibility. If you use
|
|
4008 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4009 |
|
|
4010 |
\sa StyleOptionType
|
|
4011 |
*/
|
|
4012 |
|
|
4013 |
/*!
|
|
4014 |
\variable QStyleOptionToolBox::icon
|
|
4015 |
\brief the icon for the tool box tab
|
|
4016 |
|
|
4017 |
The default value is an empty icon, i.e. an icon with neither a
|
|
4018 |
pixmap nor a filename.
|
|
4019 |
*/
|
|
4020 |
|
|
4021 |
/*!
|
|
4022 |
\variable QStyleOptionToolBox::text
|
|
4023 |
\brief the text for the tool box tab
|
|
4024 |
|
|
4025 |
The default value is an empty string.
|
|
4026 |
*/
|
|
4027 |
|
|
4028 |
/*!
|
|
4029 |
\class QStyleOptionToolBoxV2
|
|
4030 |
\brief The QStyleOptionToolBoxV2 class is used to describe the parameters necessary for drawing a frame in Qt 4.3 or above.
|
|
4031 |
|
|
4032 |
\since 4.3
|
|
4033 |
QStyleOptionToolBoxV2 inherits QStyleOptionToolBox which is used for
|
|
4034 |
drawing the tabs in a QToolBox.
|
|
4035 |
|
|
4036 |
An instance of the QStyleOptionToolBoxV2 class has
|
|
4037 |
\l{QStyleOption::type} {type} SO_ToolBox and
|
|
4038 |
\l{QStyleOption::version} {version} 2. The type is used
|
|
4039 |
internally by QStyleOption, its subclasses, and
|
|
4040 |
qstyleoption_cast() to determine the type of style option. In
|
|
4041 |
general you do not need to worry about this unless you want to
|
|
4042 |
create your own QStyleOption subclass and your own styles. The
|
|
4043 |
version is used by QStyleOption subclasses to implement extensions
|
|
4044 |
without breaking compatibility. If you use qstyleoption_cast(),
|
|
4045 |
you normally do not need to check it.
|
|
4046 |
|
|
4047 |
If you create your own QStyle subclass, you should handle both
|
|
4048 |
QStyleOptionToolBox and QStyleOptionToolBoxV2.
|
|
4049 |
|
|
4050 |
\sa QStyleOptionToolBox, QStyleOption
|
|
4051 |
*/
|
|
4052 |
|
|
4053 |
/*!
|
|
4054 |
Contsructs a QStyleOptionToolBoxV2 object.
|
|
4055 |
*/
|
|
4056 |
QStyleOptionToolBoxV2::QStyleOptionToolBoxV2()
|
|
4057 |
: QStyleOptionToolBox(Version), position(Beginning), selectedPosition(NotAdjacent)
|
|
4058 |
{
|
|
4059 |
}
|
|
4060 |
|
|
4061 |
/*!
|
|
4062 |
\fn QStyleOptionToolBoxV2::QStyleOptionToolBoxV2(const QStyleOptionToolBoxV2 &other)
|
|
4063 |
|
|
4064 |
Constructs a QStyleOptionToolBoxV2 copy of the \a other style option.
|
|
4065 |
*/
|
|
4066 |
|
|
4067 |
/*!
|
|
4068 |
\internal
|
|
4069 |
*/
|
|
4070 |
QStyleOptionToolBoxV2::QStyleOptionToolBoxV2(int version)
|
|
4071 |
: QStyleOptionToolBox(version), position(Beginning), selectedPosition(NotAdjacent)
|
|
4072 |
{
|
|
4073 |
}
|
|
4074 |
|
|
4075 |
/*!
|
|
4076 |
Constructs a QStyleOptionToolBoxV2 copy of the \a other style option
|
|
4077 |
which can be either of the QStyleOptionToolBoxV2 or
|
|
4078 |
QStyleOptionToolBox types.
|
|
4079 |
|
|
4080 |
If the \a other style option's version is 1, the new style
|
|
4081 |
option's \l{QStyleOptionTab::position} {position} value is set to
|
|
4082 |
\l QStyleOptionToolBoxV2::Beginning and \l selectedPosition is set
|
|
4083 |
to \l QStyleOptionToolBoxV2::NotAdjacent. If its version is 2, the
|
|
4084 |
\l{QStyleOptionTab::position} {position} selectedPosition values
|
|
4085 |
are simply copied to the new style option.
|
|
4086 |
|
|
4087 |
\sa version
|
|
4088 |
*/
|
|
4089 |
QStyleOptionToolBoxV2::QStyleOptionToolBoxV2(const QStyleOptionToolBox &other)
|
|
4090 |
{
|
|
4091 |
QStyleOptionToolBox::operator=(other);
|
|
4092 |
|
|
4093 |
const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
|
|
4094 |
position = f2 ? f2->position : Beginning;
|
|
4095 |
selectedPosition = f2 ? f2->selectedPosition : NotAdjacent;
|
|
4096 |
version = Version;
|
|
4097 |
}
|
|
4098 |
|
|
4099 |
/*!
|
|
4100 |
Assigns the \a other style option to this style option. The \a
|
|
4101 |
other style option can be either of the QStyleOptionToolBoxV2 or
|
|
4102 |
QStyleOptionToolBox types.
|
|
4103 |
|
|
4104 |
If the \a{other} style option's version is 1, this style option's
|
|
4105 |
\l{QStyleOptionTab::position} {position} and \l selectedPosition
|
|
4106 |
values are set to \l QStyleOptionToolBoxV2::Beginning and \l
|
|
4107 |
QStyleOptionToolBoxV2::NotAdjacent respectively. If its
|
|
4108 |
\l{QStyleOption::version} {version} is 2, these values are simply
|
|
4109 |
copied to this style option.
|
|
4110 |
*/
|
|
4111 |
QStyleOptionToolBoxV2 &QStyleOptionToolBoxV2::operator=(const QStyleOptionToolBox &other)
|
|
4112 |
{
|
|
4113 |
QStyleOptionToolBox::operator=(other);
|
|
4114 |
|
|
4115 |
const QStyleOptionToolBoxV2 *f2 = qstyleoption_cast<const QStyleOptionToolBoxV2 *>(&other);
|
|
4116 |
position = f2 ? f2->position : Beginning;
|
|
4117 |
selectedPosition = f2 ? f2->selectedPosition : NotAdjacent;
|
|
4118 |
version = Version;
|
|
4119 |
return *this;
|
|
4120 |
}
|
|
4121 |
|
|
4122 |
|
|
4123 |
/*!
|
|
4124 |
\enum QStyleOptionToolBoxV2::SelectedPosition
|
|
4125 |
|
|
4126 |
This enum describes the position of the selected tab. Some styles
|
|
4127 |
need to draw a tab differently depending on whether or not it is
|
|
4128 |
adjacent to the selected tab.
|
|
4129 |
|
|
4130 |
\value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
|
|
4131 |
\value NextIsSelected The next tab (typically the tab on the right) is selected.
|
|
4132 |
\value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
|
|
4133 |
|
|
4134 |
\sa selectedPosition
|
|
4135 |
*/
|
|
4136 |
|
|
4137 |
/*!
|
|
4138 |
\enum QStyleOptionToolBoxV2::StyleOptionVersion
|
|
4139 |
|
|
4140 |
This enum holds the version of this style option
|
|
4141 |
|
|
4142 |
\value Version 2
|
|
4143 |
*/
|
|
4144 |
|
|
4145 |
/*!
|
|
4146 |
\enum QStyleOptionToolBoxV2::TabPosition
|
|
4147 |
|
|
4148 |
This enum describes tab positions relative to other tabs.
|
|
4149 |
|
|
4150 |
\value Beginning The tab is the first (i.e., top-most) tab in
|
|
4151 |
the toolbox.
|
|
4152 |
\value Middle The tab is placed in the middle of the toolbox.
|
|
4153 |
\value End The tab is placed at the bottom of the toolbox.
|
|
4154 |
\value OnlyOneTab There is only one tab in the toolbox.
|
|
4155 |
*/
|
|
4156 |
|
|
4157 |
/*!
|
|
4158 |
\variable QStyleOptionToolBoxV2::selectedPosition
|
|
4159 |
\brief the position of the selected tab in relation to this tab
|
|
4160 |
|
|
4161 |
The default value is NotAdjacent, i.e. the tab is not adjacent to
|
|
4162 |
a selected tab nor is it the selected tab.
|
|
4163 |
*/
|
|
4164 |
|
|
4165 |
#ifndef QT_NO_RUBBERBAND
|
|
4166 |
/*!
|
|
4167 |
\class QStyleOptionRubberBand
|
|
4168 |
\brief The QStyleOptionRubberBand class is used to describe the
|
|
4169 |
parameters needed for drawing a rubber band.
|
|
4170 |
|
|
4171 |
QStyleOptionRubberBand contains all the information that
|
|
4172 |
QStyle functions need to draw QRubberBand.
|
|
4173 |
|
|
4174 |
For performance reasons, the access to the member variables is
|
|
4175 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4176 |
makes the structures straightforward to use and emphasizes that
|
|
4177 |
these are simply parameters used by the style functions.
|
|
4178 |
|
|
4179 |
For an example demonstrating how style options can be used, see
|
|
4180 |
the \l {widgets/styles}{Styles} example.
|
|
4181 |
|
|
4182 |
\sa QStyleOption, QRubberBand
|
|
4183 |
*/
|
|
4184 |
|
|
4185 |
/*!
|
|
4186 |
Creates a QStyleOptionRubberBand, initializing the members
|
|
4187 |
variables to their default values.
|
|
4188 |
*/
|
|
4189 |
|
|
4190 |
QStyleOptionRubberBand::QStyleOptionRubberBand()
|
|
4191 |
: QStyleOption(Version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
|
|
4192 |
{
|
|
4193 |
}
|
|
4194 |
|
|
4195 |
/*!
|
|
4196 |
\internal
|
|
4197 |
*/
|
|
4198 |
QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
|
|
4199 |
: QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
|
|
4200 |
{
|
|
4201 |
}
|
|
4202 |
|
|
4203 |
/*!
|
|
4204 |
\fn QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other)
|
|
4205 |
|
|
4206 |
Constructs a copy of the \a other style option.
|
|
4207 |
*/
|
|
4208 |
|
|
4209 |
/*!
|
|
4210 |
\enum QStyleOptionRubberBand::StyleOptionType
|
|
4211 |
|
|
4212 |
This enum is used to hold information about the type of the style option, and
|
|
4213 |
is defined for each QStyleOption subclass.
|
|
4214 |
|
|
4215 |
\value Type The type of style option provided (\l{SO_RubberBand} for this class).
|
|
4216 |
|
|
4217 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4218 |
qstyleoption_cast() to determine the type of style option. In
|
|
4219 |
general you do not need to worry about this unless you want to
|
|
4220 |
create your own QStyleOption subclass and your own styles.
|
|
4221 |
|
|
4222 |
\sa StyleOptionVersion
|
|
4223 |
*/
|
|
4224 |
|
|
4225 |
/*!
|
|
4226 |
\enum QStyleOptionRubberBand::StyleOptionVersion
|
|
4227 |
|
|
4228 |
This enum is used to hold information about the version of the style option, and
|
|
4229 |
is defined for each QStyleOption subclass.
|
|
4230 |
|
|
4231 |
\value Version 1
|
|
4232 |
|
|
4233 |
The version is used by QStyleOption subclasses to implement
|
|
4234 |
extensions without breaking compatibility. If you use
|
|
4235 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4236 |
|
|
4237 |
\sa StyleOptionType
|
|
4238 |
*/
|
|
4239 |
|
|
4240 |
/*!
|
|
4241 |
\variable QStyleOptionRubberBand::shape
|
|
4242 |
\brief the shape of the rubber band
|
|
4243 |
|
|
4244 |
The default shape is QRubberBand::Line.
|
|
4245 |
*/
|
|
4246 |
|
|
4247 |
/*!
|
|
4248 |
\variable QStyleOptionRubberBand::opaque
|
|
4249 |
\brief whether the rubber band is required to be drawn in an opaque style
|
|
4250 |
|
|
4251 |
The default value is true.
|
|
4252 |
*/
|
|
4253 |
#endif // QT_NO_RUBBERBAND
|
|
4254 |
|
|
4255 |
/*!
|
|
4256 |
\class QStyleOptionTitleBar
|
|
4257 |
\brief The QStyleOptionTitleBar class is used to describe the
|
|
4258 |
parameters for drawing a title bar.
|
|
4259 |
|
|
4260 |
QStyleOptionTitleBar contains all the information that QStyle
|
|
4261 |
functions need to draw the title bar of a QMdiSubWindow.
|
|
4262 |
|
|
4263 |
For performance reasons, the access to the member variables is
|
|
4264 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4265 |
makes the structures straightforward to use and emphasizes that
|
|
4266 |
these are simply parameters used by the style functions.
|
|
4267 |
|
|
4268 |
For an example demonstrating how style options can be used, see
|
|
4269 |
the \l {widgets/styles}{Styles} example.
|
|
4270 |
|
|
4271 |
\sa QStyleOption, QStyleOptionComplex, QMdiSubWindow
|
|
4272 |
*/
|
|
4273 |
|
|
4274 |
/*!
|
|
4275 |
Constructs a QStyleOptionTitleBar, initializing the members
|
|
4276 |
variables to their default values.
|
|
4277 |
*/
|
|
4278 |
|
|
4279 |
QStyleOptionTitleBar::QStyleOptionTitleBar()
|
|
4280 |
: QStyleOptionComplex(Version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
|
|
4281 |
{
|
|
4282 |
}
|
|
4283 |
|
|
4284 |
/*!
|
|
4285 |
\fn QStyleOptionTitleBar::QStyleOptionTitleBar(const QStyleOptionTitleBar &other)
|
|
4286 |
|
|
4287 |
Constructs a copy of the \a other style option.
|
|
4288 |
*/
|
|
4289 |
|
|
4290 |
/*!
|
|
4291 |
\enum QStyleOptionTitleBar::StyleOptionType
|
|
4292 |
|
|
4293 |
This enum is used to hold information about the type of the style option, and
|
|
4294 |
is defined for each QStyleOption subclass.
|
|
4295 |
|
|
4296 |
\value Type The type of style option provided (\l{SO_TitleBar} for this class).
|
|
4297 |
|
|
4298 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4299 |
qstyleoption_cast() to determine the type of style option. In
|
|
4300 |
general you do not need to worry about this unless you want to
|
|
4301 |
create your own QStyleOption subclass and your own styles.
|
|
4302 |
|
|
4303 |
\sa StyleOptionVersion
|
|
4304 |
*/
|
|
4305 |
|
|
4306 |
/*!
|
|
4307 |
\enum QStyleOptionTitleBar::StyleOptionVersion
|
|
4308 |
|
|
4309 |
This enum is used to hold information about the version of the style option, and
|
|
4310 |
is defined for each QStyleOption subclass.
|
|
4311 |
|
|
4312 |
\value Version 1
|
|
4313 |
|
|
4314 |
The version is used by QStyleOption subclasses to implement
|
|
4315 |
extensions without breaking compatibility. If you use
|
|
4316 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4317 |
|
|
4318 |
\sa StyleOptionType
|
|
4319 |
*/
|
|
4320 |
|
|
4321 |
/*!
|
|
4322 |
\internal
|
|
4323 |
*/
|
|
4324 |
QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
|
|
4325 |
: QStyleOptionComplex(version, SO_TitleBar), titleBarState(0), titleBarFlags(0)
|
|
4326 |
{
|
|
4327 |
}
|
|
4328 |
|
|
4329 |
|
|
4330 |
/*!
|
|
4331 |
\variable QStyleOptionTitleBar::text
|
|
4332 |
\brief the text of the title bar
|
|
4333 |
|
|
4334 |
The default value is an empty string.
|
|
4335 |
*/
|
|
4336 |
|
|
4337 |
/*!
|
|
4338 |
\variable QStyleOptionTitleBar::icon
|
|
4339 |
\brief the icon for the title bar
|
|
4340 |
|
|
4341 |
The default value is an empty icon, i.e. an icon with neither a
|
|
4342 |
pixmap nor a filename.
|
|
4343 |
*/
|
|
4344 |
|
|
4345 |
/*!
|
|
4346 |
\variable QStyleOptionTitleBar::titleBarState
|
|
4347 |
\brief the state of the title bar
|
|
4348 |
|
|
4349 |
This is basically the window state of the underlying widget. The
|
|
4350 |
default value is 0.
|
|
4351 |
|
|
4352 |
\sa QWidget::windowState()
|
|
4353 |
*/
|
|
4354 |
|
|
4355 |
/*!
|
|
4356 |
\variable QStyleOptionTitleBar::titleBarFlags
|
|
4357 |
\brief the widget flags for the title bar
|
|
4358 |
|
|
4359 |
The default value is Qt::Widget.
|
|
4360 |
|
|
4361 |
\sa Qt::WindowFlags
|
|
4362 |
*/
|
|
4363 |
|
|
4364 |
/*!
|
|
4365 |
\class QStyleOptionViewItem
|
|
4366 |
\brief The QStyleOptionViewItem class is used to describe the
|
|
4367 |
parameters used to draw an item in a view widget.
|
|
4368 |
|
|
4369 |
QStyleOptionViewItem contains all the information that QStyle
|
|
4370 |
functions need to draw the items for Qt's model/view classes.
|
|
4371 |
|
|
4372 |
For performance reasons, the access to the member variables is
|
|
4373 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4374 |
makes the structures straightforward to use and emphasizes that
|
|
4375 |
these are simply parameters used by the style functions.
|
|
4376 |
|
|
4377 |
For an example demonstrating how style options can be used, see
|
|
4378 |
the \l {widgets/styles}{Styles} example.
|
|
4379 |
|
|
4380 |
\sa QStyleOption, {model-view-programming.html}{Model/View
|
|
4381 |
Programming}
|
|
4382 |
*/
|
|
4383 |
|
|
4384 |
/*!
|
|
4385 |
\enum QStyleOptionViewItem::Position
|
|
4386 |
|
|
4387 |
This enum describes the position of the item's decoration.
|
|
4388 |
|
|
4389 |
\value Left On the left of the text.
|
|
4390 |
\value Right On the right of the text.
|
|
4391 |
\value Top Above the text.
|
|
4392 |
\value Bottom Below the text.
|
|
4393 |
|
|
4394 |
\sa decorationPosition
|
|
4395 |
*/
|
|
4396 |
|
|
4397 |
/*!
|
|
4398 |
\variable QStyleOptionViewItem::showDecorationSelected
|
|
4399 |
\brief whether the decoration should be highlighted on selected
|
|
4400 |
items
|
|
4401 |
|
|
4402 |
If this option is true, the branch and any decorations on selected items
|
|
4403 |
should be highlighted, indicating that the item is selected; otherwise, no
|
|
4404 |
highlighting is required. The default value is false.
|
|
4405 |
|
|
4406 |
\sa QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView
|
|
4407 |
*/
|
|
4408 |
|
|
4409 |
/*!
|
|
4410 |
\variable QStyleOptionViewItem::textElideMode
|
|
4411 |
\brief where ellipsis should be added for text that is too long to fit
|
|
4412 |
into an item
|
|
4413 |
|
|
4414 |
The default value is Qt::ElideMiddle, i.e. the ellipsis appears in
|
|
4415 |
the middle of the text.
|
|
4416 |
|
|
4417 |
\sa Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation
|
|
4418 |
*/
|
|
4419 |
|
|
4420 |
/*!
|
|
4421 |
Constructs a QStyleOptionViewItem, initializing the members
|
|
4422 |
variables to their default values.
|
|
4423 |
*/
|
|
4424 |
|
|
4425 |
QStyleOptionViewItem::QStyleOptionViewItem()
|
|
4426 |
: QStyleOption(Version, SO_ViewItem),
|
|
4427 |
displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
|
|
4428 |
textElideMode(Qt::ElideMiddle), decorationPosition(Left),
|
|
4429 |
showDecorationSelected(false)
|
|
4430 |
{
|
|
4431 |
}
|
|
4432 |
|
|
4433 |
/*!
|
|
4434 |
\internal
|
|
4435 |
*/
|
|
4436 |
QStyleOptionViewItem::QStyleOptionViewItem(int version)
|
|
4437 |
: QStyleOption(version, SO_ViewItem),
|
|
4438 |
displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
|
|
4439 |
textElideMode(Qt::ElideMiddle), decorationPosition(Left),
|
|
4440 |
showDecorationSelected(false)
|
|
4441 |
{
|
|
4442 |
}
|
|
4443 |
|
|
4444 |
/*!
|
|
4445 |
\fn QStyleOptionViewItem::QStyleOptionViewItem(const QStyleOptionViewItem &other)
|
|
4446 |
|
|
4447 |
Constructs a copy of the \a other style option.
|
|
4448 |
*/
|
|
4449 |
|
|
4450 |
/*!
|
|
4451 |
\enum QStyleOptionViewItem::StyleOptionType
|
|
4452 |
|
|
4453 |
This enum is used to hold information about the type of the style option, and
|
|
4454 |
is defined for each QStyleOption subclass.
|
|
4455 |
|
|
4456 |
\value Type The type of style option provided (\l{SO_ViewItem} for this class).
|
|
4457 |
|
|
4458 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4459 |
qstyleoption_cast() to determine the type of style option. In
|
|
4460 |
general you do not need to worry about this unless you want to
|
|
4461 |
create your own QStyleOption subclass and your own styles.
|
|
4462 |
|
|
4463 |
\sa StyleOptionVersion
|
|
4464 |
*/
|
|
4465 |
|
|
4466 |
/*!
|
|
4467 |
\enum QStyleOptionViewItem::StyleOptionVersion
|
|
4468 |
|
|
4469 |
This enum is used to hold information about the version of the style option, and
|
|
4470 |
is defined for each QStyleOption subclass.
|
|
4471 |
|
|
4472 |
\value Version 1
|
|
4473 |
|
|
4474 |
The version is used by QStyleOption subclasses to implement
|
|
4475 |
extensions without breaking compatibility. If you use
|
|
4476 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4477 |
|
|
4478 |
\sa StyleOptionType
|
|
4479 |
*/
|
|
4480 |
|
|
4481 |
/*!
|
|
4482 |
\variable QStyleOptionViewItem::displayAlignment
|
|
4483 |
\brief the alignment of the display value for the item
|
|
4484 |
|
|
4485 |
The default value is Qt::AlignLeft.
|
|
4486 |
*/
|
|
4487 |
|
|
4488 |
/*!
|
|
4489 |
\variable QStyleOptionViewItem::decorationAlignment
|
|
4490 |
\brief the alignment of the decoration for the item
|
|
4491 |
|
|
4492 |
The default value is Qt::AlignLeft.
|
|
4493 |
*/
|
|
4494 |
|
|
4495 |
/*!
|
|
4496 |
\variable QStyleOptionViewItem::decorationPosition
|
|
4497 |
\brief the position of the decoration for the item
|
|
4498 |
|
|
4499 |
The default value is \l Left.
|
|
4500 |
|
|
4501 |
\sa Position
|
|
4502 |
*/
|
|
4503 |
|
|
4504 |
/*!
|
|
4505 |
\variable QStyleOptionViewItem::decorationSize
|
|
4506 |
\brief the size of the decoration for the item
|
|
4507 |
|
|
4508 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
4509 |
|
|
4510 |
\sa decorationAlignment, decorationPosition
|
|
4511 |
*/
|
|
4512 |
|
|
4513 |
/*!
|
|
4514 |
\variable QStyleOptionViewItem::font
|
|
4515 |
\brief the font used for the item
|
|
4516 |
|
|
4517 |
By default, the application's default font is used.
|
|
4518 |
|
|
4519 |
\sa QFont
|
|
4520 |
*/
|
|
4521 |
|
|
4522 |
/*!
|
|
4523 |
\fn T qstyleoption_cast<T>(const QStyleOption *option)
|
|
4524 |
\relates QStyleOption
|
|
4525 |
|
|
4526 |
Returns a T or 0 depending on the \l{QStyleOption::type}{type} and
|
|
4527 |
\l{QStyleOption::version}{version} of the given \a option.
|
|
4528 |
|
|
4529 |
Example:
|
|
4530 |
|
|
4531 |
\snippet doc/src/snippets/qstyleoption/main.cpp 4
|
|
4532 |
|
|
4533 |
\sa QStyleOption::type, QStyleOption::version
|
|
4534 |
*/
|
|
4535 |
|
|
4536 |
/*!
|
|
4537 |
\fn T qstyleoption_cast<T>(QStyleOption *option)
|
|
4538 |
\overload
|
|
4539 |
\relates QStyleOption
|
|
4540 |
|
|
4541 |
Returns a T or 0 depending on the type of the given \a option.
|
|
4542 |
*/
|
|
4543 |
|
|
4544 |
#ifndef QT_NO_TABWIDGET
|
|
4545 |
/*!
|
|
4546 |
\class QStyleOptionTabWidgetFrame
|
|
4547 |
\brief The QStyleOptionTabWidgetFrame class is used to describe the
|
|
4548 |
parameters for drawing the frame around a tab widget.
|
|
4549 |
|
|
4550 |
QStyleOptionTabWidgetFrame contains all the information that
|
|
4551 |
QStyle functions need to draw the frame around QTabWidget.
|
|
4552 |
|
|
4553 |
For performance reasons, the access to the member variables is
|
|
4554 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4555 |
makes the structures straightforward to use and emphasizes that
|
|
4556 |
these are simply parameters used by the style functions.
|
|
4557 |
|
|
4558 |
For an example demonstrating how style options can be used, see
|
|
4559 |
the \l {widgets/styles}{Styles} example.
|
|
4560 |
|
|
4561 |
\sa QStyleOption, QTabWidget
|
|
4562 |
*/
|
|
4563 |
|
|
4564 |
/*!
|
|
4565 |
Constructs a QStyleOptionTabWidgetFrame, initializing the members
|
|
4566 |
variables to their default values.
|
|
4567 |
*/
|
|
4568 |
QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame()
|
|
4569 |
: QStyleOption(Version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
|
|
4570 |
shape(QTabBar::RoundedNorth)
|
|
4571 |
{
|
|
4572 |
}
|
|
4573 |
|
|
4574 |
/*!
|
|
4575 |
\fn QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
|
|
4576 |
|
|
4577 |
Constructs a copy of \a other.
|
|
4578 |
*/
|
|
4579 |
|
|
4580 |
/*! \internal */
|
|
4581 |
QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version)
|
|
4582 |
: QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
|
|
4583 |
shape(QTabBar::RoundedNorth)
|
|
4584 |
{
|
|
4585 |
}
|
|
4586 |
|
|
4587 |
/*!
|
|
4588 |
\enum QStyleOptionTabWidgetFrame::StyleOptionType
|
|
4589 |
|
|
4590 |
This enum is used to hold information about the type of the style option, and
|
|
4591 |
is defined for each QStyleOption subclass.
|
|
4592 |
|
|
4593 |
\value Type The type of style option provided (\l{SO_TabWidgetFrame} for this class).
|
|
4594 |
|
|
4595 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4596 |
qstyleoption_cast() to determine the type of style option. In
|
|
4597 |
general you do not need to worry about this unless you want to
|
|
4598 |
create your own QStyleOption subclass and your own styles.
|
|
4599 |
|
|
4600 |
\sa StyleOptionVersion
|
|
4601 |
*/
|
|
4602 |
|
|
4603 |
/*!
|
|
4604 |
\enum QStyleOptionTabWidgetFrame::StyleOptionVersion
|
|
4605 |
|
|
4606 |
This enum is used to hold information about the version of the style option, and
|
|
4607 |
is defined for each QStyleOption subclass.
|
|
4608 |
|
|
4609 |
\value Version 1
|
|
4610 |
|
|
4611 |
The version is used by QStyleOption subclasses to implement
|
|
4612 |
extensions without breaking compatibility. If you use
|
|
4613 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4614 |
|
|
4615 |
\sa StyleOptionType
|
|
4616 |
*/
|
|
4617 |
|
|
4618 |
/*!
|
|
4619 |
\variable QStyleOptionTabWidgetFrame::lineWidth
|
|
4620 |
\brief the line width for drawing the panel
|
|
4621 |
|
|
4622 |
The default value is 0.
|
|
4623 |
*/
|
|
4624 |
|
|
4625 |
/*!
|
|
4626 |
\variable QStyleOptionTabWidgetFrame::midLineWidth
|
|
4627 |
\brief the mid-line width for drawing the panel
|
|
4628 |
|
|
4629 |
The mid line width is usually used in drawing sunken or raised
|
|
4630 |
frames. The default value is 0.
|
|
4631 |
*/
|
|
4632 |
|
|
4633 |
/*!
|
|
4634 |
\variable QStyleOptionTabWidgetFrame::shape
|
|
4635 |
\brief the tab shape used to draw the tabs
|
|
4636 |
|
|
4637 |
The default value is QTabBar::RoundedNorth.
|
|
4638 |
*/
|
|
4639 |
|
|
4640 |
/*!
|
|
4641 |
\variable QStyleOptionTabWidgetFrame::tabBarSize
|
|
4642 |
\brief the size of the tab bar
|
|
4643 |
|
|
4644 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
4645 |
*/
|
|
4646 |
|
|
4647 |
/*!
|
|
4648 |
\variable QStyleOptionTabWidgetFrame::rightCornerWidgetSize
|
|
4649 |
\brief the size of the right-corner widget
|
|
4650 |
|
|
4651 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
4652 |
*/
|
|
4653 |
|
|
4654 |
/*! \variable QStyleOptionTabWidgetFrame::leftCornerWidgetSize
|
|
4655 |
\brief the size of the left-corner widget
|
|
4656 |
|
|
4657 |
The default value is QSize(-1, -1), i.e. an invalid size.
|
|
4658 |
*/
|
|
4659 |
#endif // QT_NO_TABWIDGET
|
|
4660 |
|
|
4661 |
#ifndef QT_NO_TABBAR
|
|
4662 |
|
|
4663 |
/*!
|
|
4664 |
\class QStyleOptionTabBarBase
|
|
4665 |
\brief The QStyleOptionTabBarBase class is used to describe
|
|
4666 |
the base of a tab bar, i.e. the part that the tab bar usually
|
|
4667 |
overlaps with.
|
|
4668 |
|
|
4669 |
QStyleOptionTabBarBase contains all the information that QStyle
|
|
4670 |
functions need to draw the tab bar base. Note that this is only
|
|
4671 |
drawn for a standalone QTabBar (one that isn't part of a
|
|
4672 |
QTabWidget).
|
|
4673 |
|
|
4674 |
For performance reasons, the access to the member variables is
|
|
4675 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4676 |
makes the structures straightforward to use and emphasizes that
|
|
4677 |
these are simply parameters used by the style functions.
|
|
4678 |
|
|
4679 |
For an example demonstrating how style options can be used, see
|
|
4680 |
the \l {widgets/styles}{Styles} example.
|
|
4681 |
|
|
4682 |
\sa QStyleOption, QTabBar::drawBase()
|
|
4683 |
*/
|
|
4684 |
|
|
4685 |
/*!
|
|
4686 |
Construct a QStyleOptionTabBarBase, initializing the members
|
|
4687 |
vaiables to their default values.
|
|
4688 |
*/
|
|
4689 |
QStyleOptionTabBarBase::QStyleOptionTabBarBase()
|
|
4690 |
: QStyleOption(Version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
|
|
4691 |
{
|
|
4692 |
}
|
|
4693 |
|
|
4694 |
/*! \internal */
|
|
4695 |
QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
|
|
4696 |
: QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth)
|
|
4697 |
{
|
|
4698 |
}
|
|
4699 |
|
|
4700 |
/*!
|
|
4701 |
\fn QStyleOptionTabBarBase::QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other)
|
|
4702 |
|
|
4703 |
Constructs a copy of \a other.
|
|
4704 |
*/
|
|
4705 |
|
|
4706 |
/*!
|
|
4707 |
\enum QStyleOptionTabBarBase::StyleOptionType
|
|
4708 |
|
|
4709 |
This enum is used to hold information about the type of the style option, and
|
|
4710 |
is defined for each QStyleOption subclass.
|
|
4711 |
|
|
4712 |
\value Type The type of style option provided (\l{SO_TabBarBase} for this class).
|
|
4713 |
|
|
4714 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4715 |
qstyleoption_cast() to determine the type of style option. In
|
|
4716 |
general you do not need to worry about this unless you want to
|
|
4717 |
create your own QStyleOption subclass and your own styles.
|
|
4718 |
|
|
4719 |
\sa StyleOptionVersion
|
|
4720 |
*/
|
|
4721 |
|
|
4722 |
/*!
|
|
4723 |
\enum QStyleOptionTabBarBase::StyleOptionVersion
|
|
4724 |
|
|
4725 |
This enum is used to hold information about the version of the style option, and
|
|
4726 |
is defined for each QStyleOption subclass.
|
|
4727 |
|
|
4728 |
\value Version 1
|
|
4729 |
|
|
4730 |
The version is used by QStyleOption subclasses to implement
|
|
4731 |
extensions without breaking compatibility. If you use
|
|
4732 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4733 |
|
|
4734 |
\sa StyleOptionType
|
|
4735 |
*/
|
|
4736 |
|
|
4737 |
/*!
|
|
4738 |
\variable QStyleOptionTabBarBase::shape
|
|
4739 |
\brief the shape of the tab bar
|
|
4740 |
|
|
4741 |
The default value is QTabBar::RoundedNorth.
|
|
4742 |
*/
|
|
4743 |
|
|
4744 |
/*!
|
|
4745 |
\variable QStyleOptionTabBarBase::tabBarRect
|
|
4746 |
\brief the rectangle containing all the tabs
|
|
4747 |
|
|
4748 |
The default value is a null rectangle, i.e. a rectangle with both
|
|
4749 |
the width and the height set to 0.
|
|
4750 |
*/
|
|
4751 |
|
|
4752 |
/*!
|
|
4753 |
\variable QStyleOptionTabBarBase::selectedTabRect
|
|
4754 |
\brief the rectangle containing the selected tab
|
|
4755 |
|
|
4756 |
This rectangle is contained within the tabBarRect. The default
|
|
4757 |
value is a null rectangle, i.e. a rectangle with both the width
|
|
4758 |
and the height set to 0.
|
|
4759 |
*/
|
|
4760 |
|
|
4761 |
|
|
4762 |
/*!
|
|
4763 |
\class QStyleOptionTabBarBaseV2
|
|
4764 |
\brief The QStyleOptionTabBarBaseV2 class is used to describe
|
|
4765 |
the base of a tab bar, i.e. the part that the tab bar usually
|
|
4766 |
overlaps with.
|
|
4767 |
\since 4.5
|
|
4768 |
|
|
4769 |
QStyleOptionTabBarBase contains all the information that QStyle
|
|
4770 |
functions need to draw the tab bar base.
|
|
4771 |
|
|
4772 |
For performance reasons, the access to the member variables is
|
|
4773 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4774 |
makes the structures straightforward to use and emphasizes that
|
|
4775 |
these are simply parameters used by the style functions.
|
|
4776 |
|
|
4777 |
For an example demonstrating how style options can be used, see
|
|
4778 |
the \l {widgets/styles}{Styles} example.
|
|
4779 |
|
|
4780 |
\sa QStyleOption, QTabBar::drawBase()
|
|
4781 |
*/
|
|
4782 |
|
|
4783 |
/*!
|
|
4784 |
\enum QStyleOptionTabBarBaseV2::StyleOptionVersion
|
|
4785 |
|
|
4786 |
This enum is used to hold information about the version of the style option, and
|
|
4787 |
is defined for each QStyleOption subclass.
|
|
4788 |
|
|
4789 |
\value Version 2
|
|
4790 |
|
|
4791 |
The version is used by QStyleOption subclasses to implement
|
|
4792 |
extensions without breaking compatibility. If you use
|
|
4793 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4794 |
|
|
4795 |
\sa StyleOptionType
|
|
4796 |
*/
|
|
4797 |
|
|
4798 |
/*!
|
|
4799 |
\variable QStyleOptionTabBarBaseV2::documentMode
|
|
4800 |
\brief whether the tabbar is in document mode.
|
|
4801 |
|
|
4802 |
The default value is false;
|
|
4803 |
*/
|
|
4804 |
|
|
4805 |
/*!
|
|
4806 |
Construct a QStyleOptionTabBarBaseV2, initializing the members
|
|
4807 |
vaiables to their default values.
|
|
4808 |
*/
|
|
4809 |
QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2()
|
|
4810 |
: QStyleOptionTabBarBase(Version)
|
|
4811 |
, documentMode(false)
|
|
4812 |
{
|
|
4813 |
}
|
|
4814 |
|
|
4815 |
/*!
|
|
4816 |
\fn QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(const QStyleOptionTabBarBaseV2 &other)
|
|
4817 |
|
|
4818 |
Constructs a copy of \a other.
|
|
4819 |
*/
|
|
4820 |
|
|
4821 |
/*!
|
|
4822 |
Constructs a copy of \a other.
|
|
4823 |
*/
|
|
4824 |
QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(const QStyleOptionTabBarBase &other)
|
|
4825 |
: QStyleOptionTabBarBase(Version)
|
|
4826 |
{
|
|
4827 |
(void)QStyleOptionTabBarBaseV2::operator=(other);
|
|
4828 |
}
|
|
4829 |
|
|
4830 |
/*!
|
|
4831 |
Constructs a QStyleOptionTabBarBaseV2 copy of the \a other style option
|
|
4832 |
which can be either of the QStyleOptionTabBarBaseV2, or QStyleOptionTabBarBase types.
|
|
4833 |
|
|
4834 |
If the other style option's version is not 1, the new style option's
|
|
4835 |
\c documentMode is set to false. If its version is 2, its \c documentMode value
|
|
4836 |
is simply copied to the new style option.
|
|
4837 |
*/
|
|
4838 |
QStyleOptionTabBarBaseV2 &QStyleOptionTabBarBaseV2::operator = (const QStyleOptionTabBarBase &other)
|
|
4839 |
{
|
|
4840 |
QStyleOptionTabBarBase::operator=(other);
|
|
4841 |
const QStyleOptionTabBarBaseV2 *v2 = qstyleoption_cast<const QStyleOptionTabBarBaseV2*>(&other);
|
|
4842 |
documentMode = v2 ? v2->documentMode : false;
|
|
4843 |
return *this;
|
|
4844 |
}
|
|
4845 |
|
|
4846 |
/*! \internal */
|
|
4847 |
QStyleOptionTabBarBaseV2::QStyleOptionTabBarBaseV2(int version)
|
|
4848 |
: QStyleOptionTabBarBase(version), documentMode(false)
|
|
4849 |
{
|
|
4850 |
}
|
|
4851 |
|
|
4852 |
#endif // QT_NO_TABBAR
|
|
4853 |
|
|
4854 |
#ifndef QT_NO_SIZEGRIP
|
|
4855 |
/*!
|
|
4856 |
\class QStyleOptionSizeGrip
|
|
4857 |
\brief The QStyleOptionSizeGrip class is used to describe the
|
|
4858 |
parameter for drawing a size grip.
|
|
4859 |
\since 4.2
|
|
4860 |
|
|
4861 |
QStyleOptionButton contains all the information that QStyle
|
|
4862 |
functions need to draw QSizeGrip.
|
|
4863 |
|
|
4864 |
For performance reasons, the access to the member variables is
|
|
4865 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4866 |
makes the structures straightforward to use and emphasizes that
|
|
4867 |
these are simply parameters used by the style functions.
|
|
4868 |
|
|
4869 |
For an example demonstrating how style options can be used, see
|
|
4870 |
the \l {widgets/styles}{Styles} example.
|
|
4871 |
|
|
4872 |
\sa QStyleOption, QStyleOptionComplex, QSizeGrip
|
|
4873 |
*/
|
|
4874 |
|
|
4875 |
/*!
|
|
4876 |
Constructs a QStyleOptionSizeGrip.
|
|
4877 |
*/
|
|
4878 |
QStyleOptionSizeGrip::QStyleOptionSizeGrip()
|
|
4879 |
: QStyleOptionComplex(Version, Type), corner(Qt::BottomRightCorner)
|
|
4880 |
{
|
|
4881 |
}
|
|
4882 |
|
|
4883 |
/*!
|
|
4884 |
\fn QStyleOptionSizeGrip::QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other)
|
|
4885 |
|
|
4886 |
Constructs a copy of the \a other style option.
|
|
4887 |
*/
|
|
4888 |
|
|
4889 |
/*!
|
|
4890 |
\internal
|
|
4891 |
*/
|
|
4892 |
QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
|
|
4893 |
: QStyleOptionComplex(version, Type), corner(Qt::BottomRightCorner)
|
|
4894 |
{
|
|
4895 |
}
|
|
4896 |
|
|
4897 |
/*!
|
|
4898 |
\variable QStyleOptionSizeGrip::corner
|
|
4899 |
|
|
4900 |
The corner in which the size grip is located.
|
|
4901 |
*/
|
|
4902 |
|
|
4903 |
/*!
|
|
4904 |
\enum QStyleOptionSizeGrip::StyleOptionType
|
|
4905 |
|
|
4906 |
This enum is used to hold information about the type of the style option, and
|
|
4907 |
is defined for each QStyleOption subclass.
|
|
4908 |
|
|
4909 |
\value Type The type of style option provided (\l{SO_TabBarBase} for this class).
|
|
4910 |
|
|
4911 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4912 |
qstyleoption_cast() to determine the type of style option. In
|
|
4913 |
general you do not need to worry about this unless you want to
|
|
4914 |
create your own QStyleOption subclass and your own styles.
|
|
4915 |
|
|
4916 |
\sa StyleOptionVersion
|
|
4917 |
*/
|
|
4918 |
|
|
4919 |
/*!
|
|
4920 |
\enum QStyleOptionSizeGrip::StyleOptionVersion
|
|
4921 |
|
|
4922 |
This enum is used to hold information about the version of the style option, and
|
|
4923 |
is defined for each QStyleOption subclass.
|
|
4924 |
|
|
4925 |
\value Version 1
|
|
4926 |
|
|
4927 |
The version is used by QStyleOption subclasses to implement
|
|
4928 |
extensions without breaking compatibility. If you use
|
|
4929 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4930 |
|
|
4931 |
\sa StyleOptionType
|
|
4932 |
*/
|
|
4933 |
#endif // QT_NO_SIZEGRIP
|
|
4934 |
|
|
4935 |
/*!
|
|
4936 |
\class QStyleOptionGraphicsItem
|
|
4937 |
\brief The QStyleOptionGraphicsItem class is used to describe
|
|
4938 |
the parameters needed to draw a QGraphicsItem.
|
|
4939 |
\since 4.2
|
|
4940 |
\ingroup graphicsview-api
|
|
4941 |
|
|
4942 |
For performance reasons, the access to the member variables is
|
|
4943 |
direct (i.e., using the \c . or \c -> operator). This low-level feel
|
|
4944 |
makes the structures straightforward to use and emphasizes that
|
|
4945 |
these are simply parameters.
|
|
4946 |
|
|
4947 |
For an example demonstrating how style options can be used, see
|
|
4948 |
the \l {widgets/styles}{Styles} example.
|
|
4949 |
|
|
4950 |
\sa QStyleOption, QGraphicsItem::paint()
|
|
4951 |
*/
|
|
4952 |
|
|
4953 |
/*!
|
|
4954 |
\enum QStyleOptionGraphicsItem::StyleOptionType
|
|
4955 |
|
|
4956 |
This enum is used to hold information about the type of the style option, and
|
|
4957 |
is defined for each QStyleOption subclass.
|
|
4958 |
|
|
4959 |
\value Type The type of style option provided (\l SO_GraphicsItem for this class).
|
|
4960 |
|
|
4961 |
The type is used internally by QStyleOption, its subclasses, and
|
|
4962 |
qstyleoption_cast() to determine the type of style option. In
|
|
4963 |
general you do not need to worry about this unless you want to
|
|
4964 |
create your own QStyleOption subclass and your own styles.
|
|
4965 |
|
|
4966 |
\sa StyleOptionVersion
|
|
4967 |
*/
|
|
4968 |
|
|
4969 |
/*!
|
|
4970 |
\enum QStyleOptionGraphicsItem::StyleOptionVersion
|
|
4971 |
|
|
4972 |
This enum is used to hold information about the version of the style option, and
|
|
4973 |
is defined for each QStyleOption subclass.
|
|
4974 |
|
|
4975 |
\value Version 1
|
|
4976 |
|
|
4977 |
The version is used by QStyleOption subclasses to implement
|
|
4978 |
extensions without breaking compatibility. If you use
|
|
4979 |
qstyleoption_cast(), you normally do not need to check it.
|
|
4980 |
|
|
4981 |
\sa StyleOptionType
|
|
4982 |
*/
|
|
4983 |
|
|
4984 |
/*!
|
|
4985 |
Constructs a QStyleOptionGraphicsItem.
|
|
4986 |
*/
|
|
4987 |
QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
|
|
4988 |
: QStyleOption(Version, Type), levelOfDetail(1)
|
|
4989 |
{
|
|
4990 |
}
|
|
4991 |
|
|
4992 |
/*!
|
|
4993 |
\internal
|
|
4994 |
*/
|
|
4995 |
QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version)
|
|
4996 |
: QStyleOption(version, Type), levelOfDetail(1)
|
|
4997 |
{
|
|
4998 |
}
|
|
4999 |
|
|
5000 |
/*!
|
|
5001 |
\since 4.6
|
|
5002 |
|
|
5003 |
Returns the level of detail from the \a worldTransform.
|
|
5004 |
|
|
5005 |
Its value represents the maximum value of the height and
|
|
5006 |
width of a unity rectangle, mapped using the \a worldTransform
|
|
5007 |
of the painter used to draw the item. By default, if no
|
|
5008 |
transformations are applied, its value is 1. If zoomed out 1:2, the level
|
|
5009 |
of detail will be 0.5, and if zoomed in 2:1, its value is 2.
|
|
5010 |
*/
|
|
5011 |
qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform)
|
|
5012 |
{
|
|
5013 |
if (worldTransform.type() <= QTransform::TxTranslate)
|
|
5014 |
return 1; // Translation only? The LOD is 1.
|
|
5015 |
|
|
5016 |
// Two unit vectors.
|
|
5017 |
QLineF v1(0, 0, 1, 0);
|
|
5018 |
QLineF v2(0, 0, 0, 1);
|
|
5019 |
// LOD is the transformed area of a 1x1 rectangle.
|
|
5020 |
return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
|
|
5021 |
}
|
|
5022 |
|
|
5023 |
/*!
|
|
5024 |
\fn QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other)
|
|
5025 |
|
|
5026 |
Constructs a copy of \a other.
|
|
5027 |
*/
|
|
5028 |
|
|
5029 |
/*!
|
|
5030 |
\variable QStyleOptionGraphicsItem::exposedRect
|
|
5031 |
\brief the exposed rectangle, in item coordinates
|
|
5032 |
|
|
5033 |
Make use of this rectangle to speed up item drawing when only parts of the
|
|
5034 |
item are exposed. If the whole item is exposed, this rectangle will be the
|
|
5035 |
same as QGraphicsItem::boundingRect().
|
|
5036 |
|
|
5037 |
This member is only initialized for items that have the
|
|
5038 |
QGraphicsItem::ItemUsesExtendedStyleOption flag set.
|
|
5039 |
*/
|
|
5040 |
|
|
5041 |
/*!
|
|
5042 |
\variable QStyleOptionGraphicsItem::matrix
|
|
5043 |
\brief the complete transformation matrix for the item
|
|
5044 |
\obsolete
|
|
5045 |
|
|
5046 |
The QMatrix provided through this member does include information about
|
|
5047 |
any perspective transformations applied to the view or item. To get the
|
|
5048 |
correct transformation matrix, use QPainter::transform() on the painter
|
|
5049 |
passed into the QGraphicsItem::paint() implementation.
|
|
5050 |
|
|
5051 |
This matrix is the combination of the item's scene matrix and the matrix
|
|
5052 |
of the painter used for drawing the item. It is provided for convenience,
|
|
5053 |
allowing anvanced level-of-detail metrics that can be used to speed up
|
|
5054 |
item drawing.
|
|
5055 |
|
|
5056 |
To find the dimensions of an item in screen coordinates (i.e., pixels),
|
|
5057 |
you can use the mapping functions of QMatrix, such as QMatrix::map().
|
|
5058 |
|
|
5059 |
This member is only initialized for items that have the
|
|
5060 |
QGraphicsItem::ItemUsesExtendedStyleOption flag set.
|
|
5061 |
|
|
5062 |
\sa QStyleOptionGraphicsItem::levelOfDetailFromTransform()
|
|
5063 |
*/
|
|
5064 |
|
|
5065 |
/*!
|
|
5066 |
\variable QStyleOptionGraphicsItem::levelOfDetail
|
|
5067 |
\obsolete
|
|
5068 |
|
|
5069 |
Use QStyleOptionGraphicsItem::levelOfDetailFromTransform()
|
|
5070 |
together with QPainter::worldTransform() instead.
|
|
5071 |
*/
|
|
5072 |
|
|
5073 |
/*!
|
|
5074 |
\class QStyleHintReturn
|
|
5075 |
\brief The QStyleHintReturn class provides style hints that return more
|
|
5076 |
than basic data types.
|
|
5077 |
|
|
5078 |
\ingroup appearance
|
|
5079 |
|
|
5080 |
QStyleHintReturn and its subclasses are used to pass information
|
|
5081 |
from a style back to the querying widget. This is most useful
|
|
5082 |
when the return value from QStyle::styleHint() does not provide enough
|
|
5083 |
detail; for example, when a mask is to be returned.
|
|
5084 |
|
|
5085 |
\omit
|
|
5086 |
### --Sam
|
|
5087 |
\endomit
|
|
5088 |
*/
|
|
5089 |
|
|
5090 |
/*!
|
|
5091 |
\enum QStyleHintReturn::HintReturnType
|
|
5092 |
|
|
5093 |
\value SH_Default QStyleHintReturn
|
|
5094 |
\value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
|
|
5095 |
\value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat
|
|
5096 |
*/
|
|
5097 |
|
|
5098 |
/*!
|
|
5099 |
\enum QStyleHintReturn::StyleOptionType
|
|
5100 |
|
|
5101 |
This enum is used to hold information about the type of the style option, and
|
|
5102 |
is defined for each QStyleHintReturn subclass.
|
|
5103 |
|
|
5104 |
\value Type The type of style option provided (\l SH_Default for
|
|
5105 |
this class).
|
|
5106 |
|
|
5107 |
The type is used internally by QStyleHintReturn, its subclasses, and
|
|
5108 |
qstyleoption_cast() to determine the type of style option. In
|
|
5109 |
general you do not need to worry about this unless you want to
|
|
5110 |
create your own QStyleHintReturn subclass and your own styles.
|
|
5111 |
|
|
5112 |
\sa StyleOptionVersion
|
|
5113 |
*/
|
|
5114 |
|
|
5115 |
/*!
|
|
5116 |
\enum QStyleHintReturn::StyleOptionVersion
|
|
5117 |
|
|
5118 |
This enum is used to hold information about the version of the style option, and
|
|
5119 |
is defined for each QStyleHintReturn subclass.
|
|
5120 |
|
|
5121 |
\value Version 1
|
|
5122 |
|
|
5123 |
The version is used by QStyleHintReturn subclasses to implement
|
|
5124 |
extensions without breaking compatibility. If you use
|
|
5125 |
qstyleoption_cast(), you normally do not need to check it.
|
|
5126 |
|
|
5127 |
\sa StyleOptionType
|
|
5128 |
*/
|
|
5129 |
|
|
5130 |
/*!
|
|
5131 |
\variable QStyleHintReturn::type
|
|
5132 |
\brief the type of the style hint container
|
|
5133 |
|
|
5134 |
\sa HintReturnType
|
|
5135 |
*/
|
|
5136 |
|
|
5137 |
/*!
|
|
5138 |
\variable QStyleHintReturn::version
|
|
5139 |
\brief the version of the style hint return container
|
|
5140 |
|
|
5141 |
This value can be used by subclasses to implement extensions
|
|
5142 |
without breaking compatibility. If you use qstyleoption_cast<T>(), you
|
|
5143 |
normally do not need to check it.
|
|
5144 |
*/
|
|
5145 |
|
|
5146 |
/*!
|
|
5147 |
Constructs a QStyleHintReturn with version \a version and type \a
|
|
5148 |
type.
|
|
5149 |
|
|
5150 |
The version has no special meaning for QStyleHintReturn; it can be
|
|
5151 |
used by subclasses to distinguish between different version of
|
|
5152 |
the same hint type.
|
|
5153 |
|
|
5154 |
\sa QStyleOption::version, QStyleOption::type
|
|
5155 |
*/
|
|
5156 |
|
|
5157 |
QStyleHintReturn::QStyleHintReturn(int version, int type)
|
|
5158 |
: version(version), type(type)
|
|
5159 |
{
|
|
5160 |
}
|
|
5161 |
|
|
5162 |
/*!
|
|
5163 |
\internal
|
|
5164 |
*/
|
|
5165 |
|
|
5166 |
QStyleHintReturn::~QStyleHintReturn()
|
|
5167 |
{
|
|
5168 |
|
|
5169 |
}
|
|
5170 |
|
|
5171 |
/*!
|
|
5172 |
\class QStyleHintReturnMask
|
|
5173 |
\brief The QStyleHintReturnMask class provides style hints that return a QRegion.
|
|
5174 |
|
|
5175 |
\ingroup appearance
|
|
5176 |
|
|
5177 |
\omit
|
|
5178 |
### --Sam
|
|
5179 |
\endomit
|
|
5180 |
*/
|
|
5181 |
|
|
5182 |
/*!
|
|
5183 |
\variable QStyleHintReturnMask::region
|
|
5184 |
\brief the region for style hints that return a QRegion
|
|
5185 |
*/
|
|
5186 |
|
|
5187 |
/*!
|
|
5188 |
Constructs a QStyleHintReturnMask. The member variables are
|
|
5189 |
initialized to default values.
|
|
5190 |
*/
|
|
5191 |
QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type)
|
|
5192 |
{
|
|
5193 |
}
|
|
5194 |
|
|
5195 |
/*!
|
|
5196 |
\enum QStyleHintReturnMask::StyleOptionType
|
|
5197 |
|
|
5198 |
This enum is used to hold information about the type of the style option, and
|
|
5199 |
is defined for each QStyleHintReturn subclass.
|
|
5200 |
|
|
5201 |
\value Type The type of style option provided (\l{SH_Mask} for
|
|
5202 |
this class).
|
|
5203 |
|
|
5204 |
The type is used internally by QStyleHintReturn, its subclasses, and
|
|
5205 |
qstyleoption_cast() to determine the type of style option. In
|
|
5206 |
general you do not need to worry about this unless you want to
|
|
5207 |
create your own QStyleHintReturn subclass and your own styles.
|
|
5208 |
|
|
5209 |
\sa StyleOptionVersion
|
|
5210 |
*/
|
|
5211 |
|
|
5212 |
/*!
|
|
5213 |
\enum QStyleHintReturnMask::StyleOptionVersion
|
|
5214 |
|
|
5215 |
This enum is used to hold information about the version of the style option, and
|
|
5216 |
is defined for each QStyleHintReturn subclass.
|
|
5217 |
|
|
5218 |
\value Version 1
|
|
5219 |
|
|
5220 |
The version is used by QStyleHintReturn subclasses to implement
|
|
5221 |
extensions without breaking compatibility. If you use
|
|
5222 |
qstyleoption_cast(), you normally do not need to check it.
|
|
5223 |
|
|
5224 |
\sa StyleOptionType
|
|
5225 |
*/
|
|
5226 |
|
|
5227 |
/*!
|
|
5228 |
\class QStyleHintReturnVariant
|
|
5229 |
\brief The QStyleHintReturnVariant class provides style hints that return a QVariant.
|
|
5230 |
\since 4.3
|
|
5231 |
\ingroup appearance
|
|
5232 |
*/
|
|
5233 |
|
|
5234 |
/*!
|
|
5235 |
\variable QStyleHintReturnVariant::variant
|
|
5236 |
\brief the variant for style hints that return a QVariant
|
|
5237 |
*/
|
|
5238 |
|
|
5239 |
/*!
|
|
5240 |
Constructs a QStyleHintReturnVariant. The member variables are
|
|
5241 |
initialized to default values.
|
|
5242 |
*/
|
|
5243 |
QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, Type)
|
|
5244 |
{
|
|
5245 |
}
|
|
5246 |
|
|
5247 |
/*!
|
|
5248 |
\enum QStyleHintReturnVariant::StyleOptionType
|
|
5249 |
|
|
5250 |
This enum is used to hold information about the type of the style option, and
|
|
5251 |
is defined for each QStyleHintReturn subclass.
|
|
5252 |
|
|
5253 |
\value Type The type of style option provided (\l{SH_Variant} for
|
|
5254 |
this class).
|
|
5255 |
|
|
5256 |
The type is used internally by QStyleHintReturn, its subclasses, and
|
|
5257 |
qstyleoption_cast() to determine the type of style option. In
|
|
5258 |
general you do not need to worry about this unless you want to
|
|
5259 |
create your own QStyleHintReturn subclass and your own styles.
|
|
5260 |
|
|
5261 |
\sa StyleOptionVersion
|
|
5262 |
*/
|
|
5263 |
|
|
5264 |
/*!
|
|
5265 |
\enum QStyleHintReturnVariant::StyleOptionVersion
|
|
5266 |
|
|
5267 |
This enum is used to hold information about the version of the style option, and
|
|
5268 |
is defined for each QStyleHintReturn subclass.
|
|
5269 |
|
|
5270 |
\value Version 1
|
|
5271 |
|
|
5272 |
The version is used by QStyleHintReturn subclasses to implement
|
|
5273 |
extensions without breaking compatibility. If you use
|
|
5274 |
qstyleoption_cast(), you normally do not need to check it.
|
|
5275 |
|
|
5276 |
\sa StyleOptionType
|
|
5277 |
*/
|
|
5278 |
|
|
5279 |
/*!
|
|
5280 |
\fn T qstyleoption_cast<T>(const QStyleHintReturn *hint)
|
|
5281 |
\relates QStyleHintReturn
|
|
5282 |
|
|
5283 |
Returns a T or 0 depending on the \l{QStyleHintReturn::type}{type}
|
|
5284 |
and \l{QStyleHintReturn::version}{version} of \a hint.
|
|
5285 |
|
|
5286 |
Example:
|
|
5287 |
|
|
5288 |
\snippet doc/src/snippets/code/src_gui_styles_qstyleoption.cpp 0
|
|
5289 |
|
|
5290 |
\sa QStyleHintReturn::type, QStyleHintReturn::version
|
|
5291 |
*/
|
|
5292 |
|
|
5293 |
/*!
|
|
5294 |
\fn T qstyleoption_cast<T>(QStyleHintReturn *hint)
|
|
5295 |
\overload
|
|
5296 |
\relates QStyleHintReturn
|
|
5297 |
|
|
5298 |
Returns a T or 0 depending on the type of \a hint.
|
|
5299 |
*/
|
|
5300 |
|
|
5301 |
#if !defined(QT_NO_DEBUG) && !defined(QT_NO_DEBUG_STREAM)
|
|
5302 |
QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
|
|
5303 |
{
|
|
5304 |
switch (optionType) {
|
|
5305 |
case QStyleOption::SO_Default:
|
|
5306 |
debug << "SO_Default"; break;
|
|
5307 |
case QStyleOption::SO_FocusRect:
|
|
5308 |
debug << "SO_FocusRect"; break;
|
|
5309 |
case QStyleOption::SO_Button:
|
|
5310 |
debug << "SO_Button"; break;
|
|
5311 |
case QStyleOption::SO_Tab:
|
|
5312 |
debug << "SO_Tab"; break;
|
|
5313 |
case QStyleOption::SO_MenuItem:
|
|
5314 |
debug << "SO_MenuItem"; break;
|
|
5315 |
case QStyleOption::SO_Frame:
|
|
5316 |
debug << "SO_Frame"; break;
|
|
5317 |
case QStyleOption::SO_ProgressBar:
|
|
5318 |
debug << "SO_ProgressBar"; break;
|
|
5319 |
case QStyleOption::SO_ToolBox:
|
|
5320 |
debug << "SO_ToolBox"; break;
|
|
5321 |
case QStyleOption::SO_Header:
|
|
5322 |
debug << "SO_Header"; break;
|
|
5323 |
case QStyleOption::SO_Q3DockWindow:
|
|
5324 |
debug << "SO_Q3DockWindow"; break;
|
|
5325 |
case QStyleOption::SO_DockWidget:
|
|
5326 |
debug << "SO_DockWidget"; break;
|
|
5327 |
case QStyleOption::SO_Q3ListViewItem:
|
|
5328 |
debug << "SO_Q3ListViewItem"; break;
|
|
5329 |
case QStyleOption::SO_ViewItem:
|
|
5330 |
debug << "SO_ViewItem"; break;
|
|
5331 |
case QStyleOption::SO_TabWidgetFrame:
|
|
5332 |
debug << "SO_TabWidgetFrame"; break;
|
|
5333 |
case QStyleOption::SO_TabBarBase:
|
|
5334 |
debug << "SO_TabBarBase"; break;
|
|
5335 |
case QStyleOption::SO_RubberBand:
|
|
5336 |
debug << "SO_RubberBand"; break;
|
|
5337 |
case QStyleOption::SO_Complex:
|
|
5338 |
debug << "SO_Complex"; break;
|
|
5339 |
case QStyleOption::SO_Slider:
|
|
5340 |
debug << "SO_Slider"; break;
|
|
5341 |
case QStyleOption::SO_SpinBox:
|
|
5342 |
debug << "SO_SpinBox"; break;
|
|
5343 |
case QStyleOption::SO_ToolButton:
|
|
5344 |
debug << "SO_ToolButton"; break;
|
|
5345 |
case QStyleOption::SO_ComboBox:
|
|
5346 |
debug << "SO_ComboBox"; break;
|
|
5347 |
case QStyleOption::SO_Q3ListView:
|
|
5348 |
debug << "SO_Q3ListView"; break;
|
|
5349 |
case QStyleOption::SO_TitleBar:
|
|
5350 |
debug << "SO_TitleBar"; break;
|
|
5351 |
case QStyleOption::SO_CustomBase:
|
|
5352 |
debug << "SO_CustomBase"; break;
|
|
5353 |
case QStyleOption::SO_GroupBox:
|
|
5354 |
debug << "SO_GroupBox"; break;
|
|
5355 |
case QStyleOption::SO_ToolBar:
|
|
5356 |
debug << "SO_ToolBar"; break;
|
|
5357 |
case QStyleOption::SO_ComplexCustomBase:
|
|
5358 |
debug << "SO_ComplexCustomBase"; break;
|
|
5359 |
case QStyleOption::SO_SizeGrip:
|
|
5360 |
debug << "SO_SizeGrip"; break;
|
|
5361 |
case QStyleOption::SO_GraphicsItem:
|
|
5362 |
debug << "SO_GraphicsItem"; break;
|
|
5363 |
}
|
|
5364 |
return debug;
|
|
5365 |
}
|
|
5366 |
|
|
5367 |
QDebug operator<<(QDebug debug, const QStyleOption &option)
|
|
5368 |
{
|
|
5369 |
debug << "QStyleOption(";
|
|
5370 |
debug << QStyleOption::OptionType(option.type);
|
|
5371 |
debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
|
|
5372 |
debug << ',' << option.state;
|
|
5373 |
debug << ',' << option.rect;
|
|
5374 |
debug << ')';
|
|
5375 |
return debug;
|
|
5376 |
}
|
|
5377 |
#endif
|
|
5378 |
|
|
5379 |
QT_END_NAMESPACE
|