Qt
Internal/Contributor docs for the Qt SDK. Note: These are NOT official API docs; those are found at https://doc.qt.io/
Loading...
Searching...
No Matches
qstyleoption.cpp
Go to the documentation of this file.
1// Copyright (C) 2016 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
3// Qt-Security score:significant reason:default
4
5#include <QtWidgets/private/qtwidgetsglobal_p.h>
6#include "private/qstylehelper_p.h"
7#include "qstyleoption.h"
8#include "qapplication.h"
9#include <qdebug.h>
10#include <QtCore/qmath.h>
11
13
14/*!
15 \class QStyleOption
16 \brief The QStyleOption class stores the parameters used by QStyle functions.
17
18 \ingroup appearance
19 \inmodule QtWidgets
20
21 QStyleOption and its subclasses contain all the information that
22 QStyle functions need to draw a graphical element.
23
24 For performance reasons, there are few member functions and the
25 access to the member variables is direct (i.e., using the \c . or
26 \c -> operator). This makes the structures straightforward to use
27 and emphasizes that these are simply parameters used by the style
28 functions.
29
30 The caller of a QStyle function usually creates QStyleOption
31 objects on the stack. This combined with Qt's extensive use of
32 \l{implicit sharing} for types such as QString, QPalette, and
33 QColor ensures that no memory allocation needlessly takes place.
34
35 The following code snippet shows how to use a specific
36 QStyleOption subclass to paint a push button:
37
38 \snippet qstyleoption/main.cpp 0
39
40 In our example, the control is a QStyle::CE_PushButton, and
41 according to the QStyle::drawControl() documentation the
42 corresponding class is QStyleOptionButton.
43
44 When reimplementing QStyle functions that take a QStyleOption
45 parameter, you often need to cast the QStyleOption to a subclass.
46 For safety, you can use qstyleoption_cast() to ensure that the
47 pointer type is correct. For example:
48
49 \snippet qstyleoption/main.cpp 4
50
51 The qstyleoption_cast() function will return 0 if the object to
52 which \c option points is not of the correct type.
53
54 \sa QStyle, QStylePainter
55*/
56
57/*!
58 \enum QStyleOption::OptionType
59
60 This enum is used internally by QStyleOption, its subclasses, and
61 qstyleoption_cast() to determine the type of style option. In
62 general you do not need to worry about this unless you want to
63 create your own QStyleOption subclass and your own styles.
64
65 \value SO_Button \l QStyleOptionButton
66 \value SO_ComboBox \l QStyleOptionComboBox
67 \value SO_Complex \l QStyleOptionComplex
68 \value SO_Default QStyleOption
69 \value SO_DockWidget \l QStyleOptionDockWidget
70 \value SO_FocusRect \l QStyleOptionFocusRect
71 \value SO_Frame \l QStyleOptionFrame
72 \value SO_GraphicsItem \l QStyleOptionGraphicsItem
73 \value SO_GroupBox \l QStyleOptionGroupBox
74 \value SO_Header \l QStyleOptionHeader
75 \value SO_MenuItem \l QStyleOptionMenuItemV2
76 \value SO_ProgressBar \l QStyleOptionProgressBar
77 \value SO_RubberBand \l QStyleOptionRubberBand
78 \value SO_SizeGrip \l QStyleOptionSizeGrip
79 \value SO_Slider \l QStyleOptionSlider
80 \value SO_SpinBox \l QStyleOptionSpinBox
81 \value SO_Tab \l QStyleOptionTab
82 \value SO_TabBarBase \l QStyleOptionTabBarBase
83 \value SO_TabWidgetFrame \l QStyleOptionTabWidgetFrame
84 \value SO_TitleBar \l QStyleOptionTitleBar
85 \value SO_ToolBar \l QStyleOptionToolBar
86 \value SO_ToolBox \l QStyleOptionToolBox
87 \value SO_ToolButton \l QStyleOptionToolButton
88 \value SO_ViewItem \l QStyleOptionViewItem (used in Interviews)
89
90 The following values are used for custom controls:
91
92 \value SO_CustomBase Reserved for custom QStyleOptions;
93 all custom controls values must be above this value
94 \value SO_ComplexCustomBase Reserved for custom QStyleOptions;
95 all custom complex controls values must be above this value
96
97 \sa type
98*/
99
100/*!
101 Constructs a QStyleOption with the specified \a version and \a
102 type.
103
104 The version has no special meaning for QStyleOption; it can be
105 used by subclasses to distinguish between different version of
106 the same option type.
107
108 The \l state member variable is initialized to
109 QStyle::State_None.
110
111 \sa version, type
112*/
113
114QStyleOption::QStyleOption(int version, int type)
115 : version(version), type(type), state(QStyle::State_None),
116 direction(QGuiApplication::layoutDirection()), fontMetrics(QFont()), styleObject(nullptr)
117{
118}
119
120
121/*!
122 Destroys this style option object.
123*/
124QStyleOption::~QStyleOption()
125{
126}
127
128/*!
129 \fn void QStyleOption::initFrom(const QWidget *widget)
130 \since 4.1
131
132 Initializes the \l state, \l direction, \l rect, \l palette, \l fontMetrics
133 and \l styleObject member variables based on the specified \a widget.
134
135 This is a convenience function; the member variables can also be
136 initialized manually.
137
138 \sa QWidget::layoutDirection(), QWidget::rect(),
139 QWidget::palette(), QWidget::fontMetrics()
140*/
141void QStyleOption::initFrom(const QWidget *widget)
142{
143 QWidget *window = widget->window();
144 state = QStyle::State_None;
145 if (widget->isEnabled())
146 state |= QStyle::State_Enabled;
147 if (widget->hasFocus())
148 state |= QStyle::State_HasFocus;
149 if (window->testAttribute(Qt::WA_KeyboardFocusChange))
150 state |= QStyle::State_KeyboardFocusChange;
151 if (widget->underMouse())
152 state |= QStyle::State_MouseOver;
153 if (window->isActiveWindow())
154 state |= QStyle::State_Active;
155 if (widget->isWindow())
156 state |= QStyle::State_Window;
157 switch (QStyleHelper::widgetSizePolicy(widget)) {
158 case QStyleHelper::SizeSmall:
159 state |= QStyle::State_Small;
160 break;
161 case QStyleHelper::SizeMini:
162 state |= QStyle::State_Mini;
163 break;
164 default:
165 ;
166 }
167#ifdef QT_KEYPAD_NAVIGATION
168 if (widget->hasEditFocus())
169 state |= QStyle::State_HasEditFocus;
170#endif
171
172 direction = widget->layoutDirection();
173 rect = widget->rect();
174 palette = widget->palette();
175 fontMetrics = widget->fontMetrics();
176 styleObject = const_cast<QWidget*>(widget);
177}
178
179/*!
180 Constructs a copy of \a other.
181*/
182QStyleOption::QStyleOption(const QStyleOption &other)
183 : version(Version), type(Type), state(other.state),
184 direction(other.direction), rect(other.rect), fontMetrics(other.fontMetrics),
185 palette(other.palette), styleObject(other.styleObject)
186{
187}
188
189/*!
190 Assign \a other to this QStyleOption.
191*/
192QStyleOption &QStyleOption::operator=(const QStyleOption &other)
193{
194 state = other.state;
195 direction = other.direction;
196 rect = other.rect;
197 fontMetrics = other.fontMetrics;
198 palette = other.palette;
199 styleObject = other.styleObject;
200 return *this;
201}
202
203/*!
204 \enum QStyleOption::StyleOptionType
205
206 This enum is used to hold information about the type of the style option, and
207 is defined for each QStyleOption subclass.
208
209 \value Type The type of style option provided (\l{SO_Default} for
210 this class).
211
212 The type is used internally by QStyleOption, its subclasses, and
213 qstyleoption_cast() to determine the type of style option. In
214 general you do not need to worry about this unless you want to
215 create your own QStyleOption subclass and your own styles.
216
217 \sa StyleOptionVersion
218*/
219
220/*!
221 \enum QStyleOption::StyleOptionVersion
222
223 This enum is used to hold information about the version of the style option, and
224 is defined for each QStyleOption subclass.
225
226 \value Version 1
227
228 The version is used by QStyleOption subclasses to implement
229 extensions without breaking compatibility. If you use
230 qstyleoption_cast(), you normally do not need to check it.
231
232 \sa StyleOptionType
233*/
234
235/*!
236 \variable QStyleOption::palette
237 \brief the palette that should be used when painting the control
238
239 By default, the application's default palette is used.
240
241 \sa initFrom()
242*/
243
244/*!
245 \variable QStyleOption::direction
246 \brief the text layout direction that should be used when drawing text in the control
247
248 By default, the layout direction is Qt::LeftToRight.
249
250 \sa initFrom()
251*/
252
253/*!
254 \variable QStyleOption::fontMetrics
255 \brief the font metrics that should be used when drawing text in the control
256
257 By default, the application's default font is used.
258
259 \sa initFrom()
260*/
261
262/*!
263 \variable QStyleOption::styleObject
264 \brief the object being styled
265
266 The built-in styles support the following types: QWidget, QGraphicsObject and QQuickItem.
267
268 \sa initFrom()
269*/
270
271/*!
272 \variable QStyleOption::rect
273 \brief the area that should be used for various calculations and painting
274
275 This can have different meanings for different types of elements.
276 For example, for a \l QStyle::CE_PushButton element it would be
277 the rectangle for the entire button, while for a \l
278 QStyle::CE_PushButtonLabel element it would be just the area for
279 the push button label.
280
281 The default value is a null rectangle, i.e. a rectangle with both
282 the width and the height set to 0.
283
284 \sa initFrom()
285*/
286
287/*!
288 \variable QStyleOption::state
289 \brief the style flags that are used when drawing the control
290
291 The default value is QStyle::State_None.
292
293 \sa initFrom(), QStyle::drawPrimitive(), QStyle::drawControl(),
294 QStyle::drawComplexControl(), QStyle::State
295*/
296
297/*!
298 \variable QStyleOption::type
299 \brief the option type of the style option
300
301 The default value is SO_Default.
302
303 \sa OptionType
304*/
305
306/*!
307 \variable QStyleOption::version
308 \brief the version of the style option
309
310 This value can be used by subclasses to implement extensions
311 without breaking compatibility. If you use the qstyleoption_cast()
312 function, you normally do not need to check it.
313
314 The default value is 1.
315*/
316
317/*!
318 \class QStyleOptionFocusRect
319 \brief The QStyleOptionFocusRect class is used to describe the
320 parameters for drawing a focus rectangle with QStyle.
321
322 \inmodule QtWidgets
323
324 For performance reasons, there are few member functions and the
325 access to the member variables is direct (i.e., using the \c . or
326 \c -> operator). This makes the structures straightforward to use
327 and emphasizes that these are simply parameters used by the style
328 functions.
329
330 \sa QStyleOption
331*/
332
333/*!
334 Constructs a QStyleOptionFocusRect, initializing the members
335 variables to their default values.
336*/
337
338QStyleOptionFocusRect::QStyleOptionFocusRect()
339 : QStyleOptionFocusRect(Version)
340{
341}
342
343/*!
344 \internal
345*/
346QStyleOptionFocusRect::QStyleOptionFocusRect(int version)
347 : QStyleOption(version, SO_FocusRect)
348{
349 state |= QStyle::State_KeyboardFocusChange; // assume we had one, will be corrected in initFrom()
350}
351
352/*!
353 \enum QStyleOptionFocusRect::StyleOptionType
354
355 This enum is used to hold information about the type of the style option, and
356 is defined for each QStyleOption subclass.
357
358 \value Type The type of style option provided (\l{SO_FocusRect} for this class).
359
360 The type is used internally by QStyleOption, its subclasses, and
361 qstyleoption_cast() to determine the type of style option. In
362 general you do not need to worry about this unless you want to
363 create your own QStyleOption subclass and your own styles.
364
365 \sa StyleOptionVersion
366*/
367
368/*!
369 \enum QStyleOptionFocusRect::StyleOptionVersion
370
371 This enum is used to hold information about the version of the style option, and
372 is defined for each QStyleOption subclass.
373
374 \value Version 1
375
376 The version is used by QStyleOption subclasses to implement
377 extensions without breaking compatibility. If you use
378 qstyleoption_cast(), you normally do not need to check it.
379
380 \sa StyleOptionType
381*/
382
383/*!
384 \fn QStyleOptionFocusRect::QStyleOptionFocusRect(const QStyleOptionFocusRect &other)
385
386 Constructs a copy of the \a other style option.
387*/
388
389/*!
390 \variable QStyleOptionFocusRect::backgroundColor
391 \brief the background color on which the focus rectangle is being drawn
392
393 The default value is an invalid color with the RGB value (0, 0,
394 0). An invalid color is a color that is not properly set up for
395 the underlying window system.
396*/
397
398/*!
399 \class QStyleOptionFrame
400 \brief The QStyleOptionFrame class is used to describe the
401 parameters for drawing a frame.
402
403 \inmodule QtWidgets
404
405 QStyleOptionFrame is used for drawing several built-in Qt widgets,
406 including QFrame, QGroupBox, QLineEdit, and QMenu.
407
408 For performance reasons, there are few member functions and the
409 access to the member variables is direct (i.e., using the \c . or
410 \c -> operator). This makes the structures straightforward to use
411 and emphasizes that these are simply parameters used by the style
412 functions.
413
414 An instance of the QStyleOptionFrame class has
415 \l{QStyleOption::type} {type} SO_Frame and \l{QStyleOption::version}
416 {version} 3.
417
418 The type is used internally by QStyleOption, its subclasses, and
419 qstyleoption_cast() to determine the type of style option. In
420 general you do not need to worry about this unless you want to
421 create your own QStyleOption subclass and your own styles. The
422 version is used by QStyleOption subclasses to implement extensions
423 without breaking compatibility. If you use qstyleoption_cast(),
424 you normally do not need to check it.
425
426 \sa QStyleOption
427*/
428
429/*!
430 Constructs a QStyleOptionFrame, initializing the members
431 variables to their default values.
432*/
433
434QStyleOptionFrame::QStyleOptionFrame()
435 : QStyleOptionFrame(Version)
436{
437}
438
439/*!
440 \internal
441*/
442QStyleOptionFrame::QStyleOptionFrame(int version)
443 : QStyleOption(version, SO_Frame), lineWidth(0), midLineWidth(0),
444 features(None), frameShape(QFrame::NoFrame)
445{
446}
447
448/*!
449 \fn QStyleOptionFrame::QStyleOptionFrame(const QStyleOptionFrame &other)
450
451 Constructs a copy of the \a other style option.
452*/
453
454/*!
455 \enum QStyleOptionFrame::StyleOptionType
456
457 This enum is used to hold information about the type of the style option, and
458 is defined for each QStyleOption subclass.
459
460 \value Type The type of style option provided (\l{SO_Frame} for this class).
461
462 The type is used internally by QStyleOption, its subclasses, and
463 qstyleoption_cast() to determine the type of style option. In
464 general you do not need to worry about this unless you want to
465 create your own QStyleOption subclass and your own styles.
466
467 \sa StyleOptionVersion
468*/
469
470/*!
471 \enum QStyleOptionFrame::StyleOptionVersion
472
473 This enum is used to hold information about the version of the style option, and
474 is defined for each QStyleOption subclass.
475
476 \value Version 3
477
478 The version is used by QStyleOption subclasses to implement
479 extensions without breaking compatibility. If you use
480 qstyleoption_cast(), you normally do not need to check it.
481
482 \sa StyleOptionType
483*/
484
485/*!
486 \variable QStyleOptionFrame::lineWidth
487 \brief the line width for drawing the frame
488
489 The default value is 0.
490
491 \sa QFrame::lineWidth
492*/
493
494/*!
495 \variable QStyleOptionFrame::midLineWidth
496 \brief the mid-line width for drawing the frame
497
498 This is usually used in drawing sunken or raised frames.
499
500 The default value is 0.
501
502 \sa QFrame::midLineWidth
503*/
504
505/*!
506 \enum QStyleOptionFrame::FrameFeature
507
508 This enum describes the different types of features a frame can have.
509
510 \value None Indicates a normal frame.
511 \value Flat Indicates a flat frame.
512 \value Rounded Indicates a rounded frame.
513*/
514
515/*!
516 \variable QStyleOptionFrame::features
517 \brief a bitwise OR of the features that describe this frame.
518
519 \sa FrameFeature
520*/
521
522/*!
523 \variable QStyleOptionFrame::frameShape
524 \brief This property holds the frame shape value of the frame.
525
526 \sa QFrame::frameShape
527*/
528
529/*!
530 \class QStyleOptionGroupBox
531 \brief The QStyleOptionGroupBox class describes the parameters for
532 drawing a group box.
533
534 \since 4.1
535 \inmodule QtWidgets
536
537 QStyleOptionButton contains all the information that QStyle
538 functions need the various graphical elements of a group box.
539
540 It holds the lineWidth and the midLineWidth for drawing the panel,
541 the group box's \l {text}{title} and the title's \l
542 {textAlignment}{alignment} and \l {textColor}{color}.
543
544 For performance reasons, there are few member functions and the
545 access to the member variables is direct (i.e., using the \c . or
546 \c -> operator). This makes the structures straightforward to use
547 and emphasizes that these are simply parameters used by the style
548 functions.
549
550 \sa QStyleOption, QStyleOptionComplex, QGroupBox
551*/
552
553/*!
554 \enum QStyleOptionGroupBox::StyleOptionType
555
556 This enum is used to hold information about the type of the style option, and
557 is defined for each QStyleOption subclass.
558
559 \value Type The type of style option provided (\l{SO_GroupBox} for this class).
560
561 The type is used internally by QStyleOption, its subclasses, and
562 qstyleoption_cast() to determine the type of style option. In
563 general you do not need to worry about this unless you want to
564 create your own QStyleOption subclass and your own styles.
565
566 \sa StyleOptionVersion
567*/
568
569/*!
570 \enum QStyleOptionGroupBox::StyleOptionVersion
571
572 This enum is used to hold information about the version of the style option, and
573 is defined for each QStyleOption subclass.
574
575 \value Version 1
576
577 The version is used by QStyleOption subclasses to implement
578 extensions without breaking compatibility. If you use
579 qstyleoption_cast(), you normally do not need to check it.
580
581 \sa StyleOptionType
582*/
583
584/*!
585 \variable QStyleOptionGroupBox::lineWidth
586 \brief the line width for drawing the panel
587
588 The value of this variable is, currently, always 1.
589
590 \sa QFrame::lineWidth
591*/
592
593/*!
594 \variable QStyleOptionGroupBox::midLineWidth
595 \brief the mid-line width for drawing the panel
596
597 The mid-line width is usually used when drawing sunken or raised
598 group box frames. The value of this variable is, currently, always 0.
599
600 \sa QFrame::midLineWidth
601*/
602
603/*!
604 \variable QStyleOptionGroupBox::text
605 \brief the text of the group box
606
607 The default value is an empty string.
608
609 \sa QGroupBox::title
610*/
611
612/*!
613 \variable QStyleOptionGroupBox::textAlignment
614 \brief the alignment of the group box title
615
616 The default value is Qt::AlignLeft.
617
618 \sa QGroupBox::alignment
619*/
620
621/*!
622 \variable QStyleOptionGroupBox::features
623 \brief the features of the group box frame
624
625 The frame is flat by default.
626
627 \sa QStyleOptionFrame::FrameFeature
628*/
629
630/*!
631 \variable QStyleOptionGroupBox::textColor
632 \brief the color of the group box title
633
634 The default value is an invalid color with the RGB value (0, 0,
635 0). An invalid color is a color that is not properly set up for
636 the underlying window system.
637*/
638
639/*!
640 Constructs a QStyleOptionGroupBox, initializing the members
641 variables to their default values.
642*/
643QStyleOptionGroupBox::QStyleOptionGroupBox()
644 : QStyleOptionGroupBox(Version)
645{
646}
647
648/*!
649 \fn QStyleOptionGroupBox::QStyleOptionGroupBox(const QStyleOptionGroupBox &other)
650
651 Constructs a copy of the \a other style option.
652*/
653
654/*!
655 \internal
656*/
657QStyleOptionGroupBox::QStyleOptionGroupBox(int version)
658 : QStyleOptionComplex(version, Type), features(QStyleOptionFrame::None),
659 textAlignment(Qt::AlignLeft), lineWidth(0), midLineWidth(0)
660{
661}
662
663/*!
664 \class QStyleOptionHeader
665 \brief The QStyleOptionHeader class is used to describe the
666 parameters for drawing a header.
667
668 \inmodule QtWidgets
669
670 QStyleOptionHeader contains all the information that QStyle
671 functions need to draw the item views' header pane, header sort
672 arrow, and header label.
673
674 For performance reasons, there are few member functions and the
675 access to the member variables is direct (i.e., using the \c . or
676 \c -> operator). This makes the structures straightforward to use
677 and emphasizes that these are simply parameters used by the style
678 functions.
679
680 \sa QStyleOption
681*/
682
683/*!
684 Constructs a QStyleOptionHeader, initializing the members
685 variables to their default values.
686*/
687
688QStyleOptionHeader::QStyleOptionHeader()
689 : QStyleOptionHeader(QStyleOptionHeader::Version)
690{
691}
692
693/*!
694 \internal
695*/
696QStyleOptionHeader::QStyleOptionHeader(int version)
697 : QStyleOption(version, SO_Header),
698 section(0), textAlignment(Qt::AlignLeft), iconAlignment(Qt::AlignLeft),
699 position(QStyleOptionHeader::Beginning),
700 selectedPosition(QStyleOptionHeader::NotAdjacent), sortIndicator(None),
701 orientation(Qt::Horizontal)
702{
703}
704
705/*!
706 \variable QStyleOptionHeader::orientation
707 \brief the header's orientation (horizontal or vertical)
708
709 The default orientation is Qt::Horizontal
710*/
711
712/*!
713 \fn QStyleOptionHeader::QStyleOptionHeader(const QStyleOptionHeader &other)
714
715 Constructs a copy of the \a other style option.
716*/
717
718/*!
719 \enum QStyleOptionHeader::StyleOptionType
720
721 This enum is used to hold information about the type of the style option, and
722 is defined for each QStyleOption subclass.
723
724 \value Type The type of style option provided (\l{SO_Header} for this class).
725
726 The type is used internally by QStyleOption, its subclasses, and
727 qstyleoption_cast() to determine the type of style option. In
728 general you do not need to worry about this unless you want to
729 create your own QStyleOption subclass and your own styles.
730
731 \sa StyleOptionVersion
732*/
733
734/*!
735 \enum QStyleOptionHeader::StyleOptionVersion
736
737 This enum is used to hold information about the version of the style option, and
738 is defined for each QStyleOption subclass.
739
740 \value Version 1
741
742 The version is used by QStyleOption subclasses to implement
743 extensions without breaking compatibility. If you use
744 qstyleoption_cast(), you normally do not need to check it.
745
746 \sa StyleOptionType
747*/
748
749/*!
750 \variable QStyleOptionHeader::section
751 \brief which section of the header is being painted
752
753 The default value is 0.
754*/
755
756/*!
757 \variable QStyleOptionHeader::text
758 \brief the text of the header
759
760 The default value is an empty string.
761*/
762
763/*!
764 \variable QStyleOptionHeader::textAlignment
765 \brief the alignment flags for the text of the header
766
767 The default value is Qt::AlignLeft.
768*/
769
770/*!
771 \variable QStyleOptionHeader::icon
772 \brief the icon of the header
773
774 The default value is an empty icon, i.e. an icon with neither a
775 pixmap nor a filename.
776*/
777
778/*!
779 \variable QStyleOptionHeader::iconAlignment
780 \brief the alignment flags for the icon of the header
781
782 The default value is Qt::AlignLeft.
783*/
784
785/*!
786 \variable QStyleOptionHeader::position
787 \brief the section's position in relation to the other sections
788
789 The default value is QStyleOptionHeader::Beginning.
790*/
791
792/*!
793 \variable QStyleOptionHeader::selectedPosition
794 \brief the section's position in relation to the selected section
795
796 The default value is QStyleOptionHeader::NotAdjacent
797*/
798
799/*!
800 \variable QStyleOptionHeader::sortIndicator
801 \brief the direction the sort indicator should be drawn
802
803 The default value is QStyleOptionHeader::None.
804*/
805
806/*!
807 \enum QStyleOptionHeader::SectionPosition
808
809 This enum lets you know where the section's position is in relation to the other sections.
810
811 \value Beginning At the beginining of the header
812 \value Middle In the middle of the header
813 \value End At the end of the header
814 \value OnlyOneSection Only one header section
815
816 \sa position
817*/
818
819/*!
820 \enum QStyleOptionHeader::SelectedPosition
821
822 This enum lets you know where the section's position is in relation to the selected section.
823
824 \value NotAdjacent Not adjacent to the selected section
825 \value NextIsSelected The next section is selected
826 \value PreviousIsSelected The previous section is selected
827 \value NextAndPreviousAreSelected Both the next and previous section are selected
828
829 \sa selectedPosition
830*/
831
832/*!
833 \enum QStyleOptionHeader::SortIndicator
834
835 Indicates which direction the sort indicator should be drawn
836
837 \value None No sort indicator is needed
838 \value SortUp Draw an up indicator
839 \value SortDown Draw a down indicator
840
841 \sa sortIndicator
842*/
843
844/*!
845 \class QStyleOptionHeaderV2
846 \brief The QStyleOptionHeaderV2 class is used to describe the
847 parameters for drawing a header.
848
849 \inmodule QtWidgets
850*/
851
852/*!
853 Constructs a QStyleOptionHeaderV2, initializing the members
854 variables to their default values.
855*/
856QStyleOptionHeaderV2::QStyleOptionHeaderV2()
857 : QStyleOptionHeaderV2(QStyleOptionHeaderV2::Version)
858{
859}
860
861/*!
862 \internal
863*/
864QStyleOptionHeaderV2::QStyleOptionHeaderV2(int version)
865: QStyleOptionHeader(version), textElideMode(Qt::ElideNone), isSectionDragTarget(false), unused(0)
866{}
867
868/*!
869 \variable QStyleOptionHeaderV2::textElideMode
870 \brief where ellipsis should be added for text that is too long to fit
871 into an item
872
873 The default value is Qt::ElideNone.
874
875 \sa Qt::TextElideMode
876*/
877
878/*!
879 \variable QStyleOptionHeaderV2::isSectionDragTarget
880
881 \brief whether the section is the location at which a dragged section
882 will be inserted
883
884 \sa QHeaderView::setSectionsMovable
885*/
886
887/*!
888 \class QStyleOptionButton
889 \brief The QStyleOptionButton class is used to describe the
890 parameters for drawing buttons.
891
892 \inmodule QtWidgets
893
894 QStyleOptionButton contains all the information that QStyle
895 functions need to draw graphical elements like QPushButton,
896 QCheckBox, and QRadioButton.
897
898 For performance reasons, there are few member functions and the
899 access to the member variables is direct (i.e., using the \c . or
900 \c -> operator). This makes the structures straightforward to use
901 and emphasizes that these are simply parameters used by the style
902 functions.
903
904 \sa QStyleOption, QStyleOptionToolButton
905*/
906
907/*!
908 \enum QStyleOptionButton::ButtonFeature
909
910 This enum describes the different types of features a push button can have.
911
912 \value None Indicates a normal push button.
913 \value Flat Indicates a flat push button.
914 \value HasMenu Indicates that the button has a drop down menu.
915 \value DefaultButton Indicates that the button is a default button.
916 \value AutoDefaultButton Indicates that the button is an auto default button.
917 \value CommandLinkButton Indicates that the button is a Windows Vista type command link.
918
919 \sa features
920*/
921
922/*!
923 Constructs a QStyleOptionButton, initializing the members
924 variables to their default values.
925*/
926
927QStyleOptionButton::QStyleOptionButton()
928 : QStyleOptionButton(QStyleOptionButton::Version)
929{
930}
931
932/*!
933 \internal
934*/
935QStyleOptionButton::QStyleOptionButton(int version)
936 : QStyleOption(version, SO_Button), features(None)
937{
938}
939
940/*!
941 \fn QStyleOptionButton::QStyleOptionButton(const QStyleOptionButton &other)
942
943 Constructs a copy of the \a other style option.
944*/
945
946/*!
947 \enum QStyleOptionButton::StyleOptionType
948
949 This enum is used to hold information about the type of the style option, and
950 is defined for each QStyleOption subclass.
951
952 \value Type The type of style option provided (\l{SO_Button} for this class).
953
954 The type is used internally by QStyleOption, its subclasses, and
955 qstyleoption_cast() to determine the type of style option. In
956 general you do not need to worry about this unless you want to
957 create your own QStyleOption subclass and your own styles.
958
959 \sa StyleOptionVersion
960*/
961
962/*!
963 \enum QStyleOptionButton::StyleOptionVersion
964
965 This enum is used to hold information about the version of the style option, and
966 is defined for each QStyleOption subclass.
967
968 \value Version 1
969
970 The version is used by QStyleOption subclasses to implement
971 extensions without breaking compatibility. If you use
972 qstyleoption_cast(), you normally do not need to check it.
973
974 \sa StyleOptionType
975*/
976
977/*!
978 \variable QStyleOptionButton::features
979 \brief a bitwise OR of the features that describe this button
980
981 \sa ButtonFeature
982*/
983
984/*!
985 \variable QStyleOptionButton::text
986 \brief the text of the button
987
988 The default value is an empty string.
989*/
990
991/*!
992 \variable QStyleOptionButton::icon
993 \brief the icon of the button
994
995 The default value is an empty icon, i.e. an icon with neither a
996 pixmap nor a filename.
997
998 \sa iconSize
999*/
1000
1001/*!
1002 \variable QStyleOptionButton::iconSize
1003 \brief the size of the icon for the button
1004
1005 The default value is QSize(-1, -1), i.e. an invalid size.
1006*/
1007
1008
1009#if QT_CONFIG(toolbar)
1010/*!
1011 \class QStyleOptionToolBar
1012 \brief The QStyleOptionToolBar class is used to describe the
1013 parameters for drawing a toolbar.
1014
1015 \since 4.1
1016 \inmodule QtWidgets
1017
1018 QStyleOptionToolBar contains all the information that QStyle
1019 functions need to draw QToolBar.
1020
1021 The QStyleOptionToolBar class holds the lineWidth and the
1022 midLineWidth for drawing the widget. It also stores information
1023 about which \l {toolBarArea}{area} the toolbar should be located
1024 in, whether it is movable or not, which position the toolbar line
1025 should have (positionOfLine), and the toolbar's position within
1026 the line (positionWithinLine).
1027
1028 In addition, the class provides a couple of enums: The
1029 ToolBarFeature enum is used to describe whether a toolbar is
1030 movable or not, and the ToolBarPosition enum is used to describe
1031 the position of a toolbar line, as well as the toolbar's position
1032 within the line.
1033
1034 For performance reasons, there are few member functions and the
1035 access to the member variables is direct (i.e., using the \c . or
1036 \c -> operator). This makes the structures straightforward to use
1037 and emphasizes that these are simply parameters used by the style
1038 functions.
1039
1040 \sa QStyleOption
1041*/
1042
1043/*!
1044 Constructs a QStyleOptionToolBar, initializing the members
1045 variables to their default values.
1046*/
1047
1048QStyleOptionToolBar::QStyleOptionToolBar()
1049 : QStyleOptionToolBar(Version)
1050{
1051}
1052
1053/*!
1054 \fn QStyleOptionToolBar::QStyleOptionToolBar(const QStyleOptionToolBar &other)
1055
1056 Constructs a copy of the \a other style option.
1057*/
1058
1059/*!
1060 \internal
1061*/
1062QStyleOptionToolBar::QStyleOptionToolBar(int version)
1063: QStyleOption(version, SO_ToolBar), positionOfLine(OnlyOne), positionWithinLine(OnlyOne),
1064 toolBarArea(Qt::TopToolBarArea), features(None), lineWidth(0), midLineWidth(0)
1065{
1066
1067}
1068
1069/*!
1070 \enum QStyleOptionToolBar::ToolBarPosition
1071
1072 \image qstyleoptiontoolbar-position.png
1073 {Diagram of thee toolbar line and the positions relative to the line}
1074
1075 This enum is used to describe the position of a toolbar line, as
1076 well as the toolbar's position within the line.
1077
1078 The order of the positions within a line starts at the top of a
1079 vertical line, and from the left within a horizontal line. The
1080 order of the positions for the lines is always from the
1081 parent widget's boundary edges.
1082
1083 \value Beginning The toolbar is located at the beginning of the line,
1084 or the toolbar line is the first of several lines. There can
1085 only be one toolbar (and only one line) with this position.
1086 \value Middle The toolbar is located in the middle of the line,
1087 or the toolbar line is in the middle of several lines. There can
1088 several toolbars (and lines) with this position.
1089 \value End The toolbar is located at the end of the line,
1090 or the toolbar line is the last of several lines. There can
1091 only be one toolbar (and only one line) with this position.
1092 \value OnlyOne There is only one toolbar or line. This is the default value
1093 of the positionOfLine and positionWithinLine variables.
1094
1095 \sa positionWithinLine, positionOfLine
1096*/
1097
1098/*!
1099 \enum QStyleOptionToolBar::ToolBarFeature
1100
1101 This enum is used to describe whether a toolbar is movable or not.
1102
1103 \value None The toolbar cannot be moved. The default value.
1104 \value Movable The toolbar is movable, and a handle will appear when
1105 holding the cursor over the toolbar's boundary.
1106
1107 \sa features, QToolBar::isMovable()
1108*/
1109
1110/*!
1111 \variable QStyleOptionToolBar::positionOfLine
1112
1113 This variable holds the position of the toolbar line.
1114
1115 The default value is QStyleOptionToolBar::OnlyOne.
1116*/
1117
1118/*!
1119 \variable QStyleOptionToolBar::positionWithinLine
1120
1121 This variable holds the position of the toolbar within a line.
1122
1123 The default value is QStyleOptionToolBar::OnlyOne.
1124*/
1125
1126/*!
1127 \variable QStyleOptionToolBar::toolBarArea
1128
1129 This variable holds the location for drawing the toolbar.
1130
1131 The default value is Qt::TopToolBarArea.
1132
1133 \sa Qt::ToolBarArea
1134*/
1135
1136/*!
1137 \variable QStyleOptionToolBar::features
1138
1139 This variable holds whether the toolbar is movable or not.
1140
1141 The default value is \l None.
1142*/
1143
1144/*!
1145 \variable QStyleOptionToolBar::lineWidth
1146
1147 This variable holds the line width for drawing the toolbar.
1148
1149 The default value is 0.
1150*/
1151
1152/*!
1153 \variable QStyleOptionToolBar::midLineWidth
1154
1155 This variable holds the mid-line width for drawing the toolbar.
1156
1157 The default value is 0.
1158*/
1159
1160/*!
1161 \enum QStyleOptionToolBar::StyleOptionType
1162
1163 This enum is used to hold information about the type of the style
1164 option, and is defined for each QStyleOption subclass.
1165
1166 \value Type The type of style option provided (\l{SO_ToolBar} for
1167 this class).
1168
1169 The type is used internally by QStyleOption, its subclasses, and
1170 qstyleoption_cast() to determine the type of style option. In
1171 general you do not need to worry about this unless you want to
1172 create your own QStyleOption subclass and your own styles.
1173
1174 \sa StyleOptionVersion
1175*/
1176
1177/*!
1178 \enum QStyleOptionToolBar::StyleOptionVersion
1179
1180 This enum is used to hold information about the version of the
1181 style option, and is defined for each QStyleOption subclass.
1182
1183 \value Version 1
1184
1185 The version is used by QStyleOption subclasses to implement
1186 extensions without breaking compatibility. If you use
1187 qstyleoption_cast(), you normally do not need to check it.
1188
1189 \sa StyleOptionType
1190*/
1191
1192#endif
1193
1194#if QT_CONFIG(tabbar)
1195/*!
1196 \class QStyleOptionTab
1197 \brief The QStyleOptionTab class is used to describe the
1198 parameters for drawing a tab bar.
1199
1200 \inmodule QtWidgets
1201
1202 The QStyleOptionTab class is used for drawing several built-in Qt
1203 widgets including \l QTabBar and the panel for \l QTabWidget.
1204
1205 An instance of the QStyleOptionTab class has
1206 \l{QStyleOption::type} {type} \l SO_Tab and
1207 \l{QStyleOption::version} {version} 3. The type is used internally
1208 by QStyleOption, its subclasses, and qstyleoption_cast() to
1209 determine the type of style option. In general you do not need to
1210 worry about this unless you want to create your own QStyleOption
1211 subclass and your own styles. The version is used by QStyleOption
1212 subclasses to implement extensions without breaking
1213 compatibility. If you use qstyleoption_cast(), you normally do not
1214 need to check it.
1215
1216 For performance reasons, there are few member functions and the
1217 access to the member variables is direct (i.e., using the \c . or
1218 \c -> operator). This makes the structures straightforward to use
1219 and emphasizes that these are simply parameters used by the style
1220 functions.
1221
1222 \sa QStyleOption
1223*/
1224
1225/*!
1226 Constructs a QStyleOptionTab object, initializing the members
1227 variables to their default values.
1228*/
1229
1230QStyleOptionTab::QStyleOptionTab()
1231 : QStyleOptionTab(QStyleOptionTab::Version)
1232{
1233}
1234
1235/*!
1236 \internal
1237*/
1238QStyleOptionTab::QStyleOptionTab(int version)
1239 : QStyleOption(version, SO_Tab),
1240 shape(QTabBar::RoundedNorth),
1241 row(0),
1242 position(Beginning),
1243 selectedPosition(NotAdjacent), cornerWidgets(QStyleOptionTab::NoCornerWidgets),
1244 documentMode(false),
1245 features(QStyleOptionTab::None)
1246{
1247}
1248
1249/*!
1250 \fn QStyleOptionTab::QStyleOptionTab(const QStyleOptionTab &other)
1251
1252 Constructs a copy of the \a other style option.
1253*/
1254
1255/*!
1256 \enum QStyleOptionTab::StyleOptionType
1257
1258 This enum is used to hold information about the type of the style option, and
1259 is defined for each QStyleOption subclass.
1260
1261 \value Type The type of style option provided (\l{SO_Tab} for this class).
1262
1263 The type is used internally by QStyleOption, its subclasses, and
1264 qstyleoption_cast() to determine the type of style option. In
1265 general you do not need to worry about this unless you want to
1266 create your own QStyleOption subclass and your own styles.
1267
1268 \sa StyleOptionVersion
1269*/
1270
1271/*!
1272 \enum QStyleOptionTab::StyleOptionVersion
1273
1274 This enum is used to hold information about the version of the style option, and
1275 is defined for each QStyleOption subclass.
1276
1277 \value Version 3
1278
1279 The version is used by QStyleOption subclasses to implement
1280 extensions without breaking compatibility. If you use
1281 qstyleoption_cast(), you normally do not need to check it.
1282
1283 \sa StyleOptionType
1284*/
1285
1286/*!
1287 \enum QStyleOptionTab::TabPosition
1288
1289 This enum describes the position of the tab.
1290
1291 \value Beginning The tab is the first tab in the tab bar.
1292 \value Middle The tab is neither the first nor the last tab in the tab bar.
1293 \value End The tab is the last tab in the tab bar.
1294 \value OnlyOneTab The tab is both the first and the last tab in the tab bar.
1295 \value [since 6.6] Moving The tab is moving by mouse drag or animation.
1296
1297 \sa position
1298*/
1299
1300/*!
1301 \enum QStyleOptionTab::CornerWidget
1302
1303 These flags indicate the corner widgets in a tab.
1304
1305 \value NoCornerWidgets There are no corner widgets
1306 \value LeftCornerWidget Left corner widget
1307 \value RightCornerWidget Right corner widget
1308
1309 \sa cornerWidgets
1310*/
1311
1312/*! \enum QStyleOptionTab::SelectedPosition
1313
1314 This enum describes the position of the selected tab. Some styles
1315 need to draw a tab differently depending on whether or not it is
1316 adjacent to the selected tab.
1317
1318 \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
1319 \value NextIsSelected The next tab (typically the tab on the right) is selected.
1320 \value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
1321
1322 \sa selectedPosition
1323*/
1324
1325/*!
1326 \variable QStyleOptionTab::selectedPosition
1327 \brief the position of the selected tab in relation to this tab
1328
1329 The default value is NotAdjacent, i.e. the tab is not adjacent to
1330 a selected tab nor is it the selected tab.
1331*/
1332
1333/*!
1334 \variable QStyleOptionTab::cornerWidgets
1335 \brief an OR combination of CornerWidget values indicating the
1336 corner widgets of the tab bar
1337
1338 The default value is NoCornerWidgets.
1339
1340 \sa CornerWidget
1341*/
1342
1343
1344/*!
1345 \variable QStyleOptionTab::shape
1346 \brief the tab shape used to draw the tab; by default
1347 QTabBar::RoundedNorth.
1348
1349 \sa QTabBar::Shape
1350*/
1351
1352/*!
1353 \variable QStyleOptionTab::text
1354 \brief the text of the tab
1355
1356 The default value is an empty string.
1357*/
1358
1359/*!
1360 \variable QStyleOptionTab::icon
1361 \brief the icon for the tab
1362
1363 The default value is an empty icon, i.e. an icon with neither a
1364 pixmap nor a filename.
1365*/
1366
1367/*!
1368 \variable QStyleOptionTab::row
1369 \brief which row the tab is currently in
1370
1371 The default value is 0, indicating the front row. Currently this
1372 property can only be 0.
1373*/
1374
1375/*!
1376 \variable QStyleOptionTab::position
1377 \brief the position of the tab in the tab bar
1378
1379 The default value is \l Beginning, i.e. the tab is the first tab
1380 in the tab bar.
1381*/
1382/*!
1383 \variable QStyleOptionTab::iconSize
1384 \brief the size for the icons
1385
1386 The default value is QSize(-1, -1), i.e. an invalid size; use
1387 QStyle::pixelMetric() to find the default icon size for tab bars.
1388
1389 \sa QTabBar::iconSize()
1390*/
1391
1392/*!
1393 \variable QStyleOptionTab::documentMode
1394 \brief whether the tabbar is in document mode.
1395
1396 The default value is false;
1397*/
1398
1399/*!
1400 \enum QStyleOptionTab::TabFeature
1401
1402 Describes the various features that a tab button can have.
1403
1404 \value None A normal tab button.
1405 \value HasFrame The tab button is positioned on a tab frame
1406 \value [since 6.9] MinimumSizeHint The tab button's minimum size hint is being measured,
1407 in contrast to its regular size hint.
1408
1409 \sa QStyleOptionToolBar::features
1410*/
1411
1412/*!
1413 \variable QStyleOptionTab::leftButtonSize
1414 \brief the size for the left widget on the tab.
1415
1416 The default value is QSize(-1, -1), i.e. an invalid size;
1417*/
1418
1419/*!
1420 \variable QStyleOptionTab::rightButtonSize
1421 \brief the size for the right widget on the tab.
1422
1423 The default value is QSize(-1, -1), i.e. an invalid size;
1424*/
1425
1426/*!
1427 \variable QStyleOptionTab::tabIndex
1428 \brief the index for the tab being represented.
1429
1430 The default value is -1, i.e. a tab not on a tabbar;
1431 */
1432
1433#endif // QT_CONFIG(tabbar)
1434
1435/*!
1436 \class QStyleOptionProgressBar
1437 \brief The QStyleOptionProgressBar class is used to describe the
1438 parameters necessary for drawing a progress bar.
1439
1440 \inmodule QtWidgets
1441
1442 An instance of the QStyleOptionProgressBar class has type
1443 SO_ProgressBar and version 2.
1444
1445 The type is used internally by QStyleOption, its subclasses, and
1446 qstyleoption_cast() to determine the type of style option. In
1447 general you do not need to worry about this unless you want to
1448 create your own QStyleOption subclass and your own styles. The
1449 version is used by QStyleOption subclasses to implement extensions
1450 without breaking compatibility. If you use qstyleoption_cast(),
1451 you normally do not need to check it.
1452
1453 For performance reasons, there are few member functions and the
1454 access to the member variables is direct (i.e., using the \c . or
1455 \c -> operator). This makes the structures straightforward to use
1456 and emphasizes that these are simply parameters used by the style
1457 functions.
1458
1459 \sa QStyleOption
1460*/
1461
1462/*!
1463 Constructs a QStyleOptionProgressBar, initializing the members
1464 variables to their default values.
1465*/
1466
1467QStyleOptionProgressBar::QStyleOptionProgressBar()
1468 : QStyleOptionProgressBar(QStyleOptionProgressBar::Version)
1469{
1470}
1471
1472/*!
1473 \internal
1474*/
1475QStyleOptionProgressBar::QStyleOptionProgressBar(int version)
1476 : QStyleOption(version, SO_ProgressBar),
1477 minimum(0), maximum(0), progress(0), textAlignment(Qt::AlignLeft), textVisible(false),
1478 invertedAppearance(false), bottomToTop(false)
1479{
1480 state |= QStyle::State_Horizontal;
1481}
1482
1483/*!
1484 \fn QStyleOptionProgressBar::QStyleOptionProgressBar(const QStyleOptionProgressBar &other)
1485
1486 Constructs a copy of the \a other style option.
1487*/
1488
1489/*!
1490 \enum QStyleOptionProgressBar::StyleOptionType
1491
1492 This enum is used to hold information about the type of the style option, and
1493 is defined for each QStyleOption subclass.
1494
1495 \value Type The type of style option provided (\l{SO_ProgressBar} for this class).
1496
1497 The type is used internally by QStyleOption, its subclasses, and
1498 qstyleoption_cast() to determine the type of style option. In
1499 general you do not need to worry about this unless you want to
1500 create your own QStyleOption subclass and your own styles.
1501
1502 \sa StyleOptionVersion
1503*/
1504
1505/*!
1506 \enum QStyleOptionProgressBar::StyleOptionVersion
1507
1508 This enum is used to hold information about the version of the style option, and
1509 is defined for each QStyleOption subclass.
1510
1511 \value Version 2
1512
1513 The version is used by QStyleOption subclasses to implement
1514 extensions without breaking compatibility. If you use
1515 qstyleoption_cast(), you normally do not need to check it.
1516
1517 \sa StyleOptionType
1518*/
1519
1520/*!
1521 \variable QStyleOptionProgressBar::minimum
1522 \brief the minimum value for the progress bar
1523
1524 This is the minimum value in the progress bar. The default value
1525 is 0.
1526
1527 \sa QProgressBar::minimum
1528*/
1529
1530/*!
1531 \variable QStyleOptionProgressBar::maximum
1532 \brief the maximum value for the progress bar
1533
1534 This is the maximum value in the progress bar. The default value
1535 is 0.
1536
1537 \sa QProgressBar::maximum
1538*/
1539
1540/*!
1541 \variable QStyleOptionProgressBar::text
1542 \brief the text for the progress bar
1543
1544 The progress bar text is usually just the progress expressed as a
1545 string. An empty string indicates that the progress bar has not
1546 started yet. The default value is an empty string.
1547
1548 \sa QProgressBar::text
1549*/
1550
1551/*!
1552 \variable QStyleOptionProgressBar::textVisible
1553 \brief a flag indicating whether or not text is visible
1554
1555 If this flag is true then the text is visible. Otherwise, the text
1556 is not visible. The default value is false.
1557
1558 \sa QProgressBar::textVisible
1559*/
1560
1561
1562/*!
1563 \variable QStyleOptionProgressBar::textAlignment
1564 \brief the text alignment for the text in the QProgressBar.
1565
1566 This can be used as a guide on where the text should be in the
1567 progress bar. The default value is Qt::AlignLeft.
1568*/
1569
1570/*!
1571 \variable QStyleOptionProgressBar::progress
1572 \brief the current progress for the progress bar
1573
1574 The current progress. A value of QStyleOptionProgressBar::minimum
1575 - 1 indicates that the progress hasn't started yet. The default
1576 value is 0.
1577
1578 \sa QProgressBar::value
1579*/
1580
1581/*!
1582 \variable QStyleOptionProgressBar::invertedAppearance
1583 \brief whether the progress bar's appearance is inverted
1584
1585 The default value is false.
1586
1587 \sa QProgressBar::invertedAppearance
1588*/
1589
1590/*!
1591 \variable QStyleOptionProgressBar::bottomToTop
1592 \brief whether the text reads from bottom to top when the progress
1593 bar is vertical
1594
1595 The default value is false.
1596
1597 \sa QProgressBar::textDirection
1598*/
1599
1600/*!
1601 \class QStyleOptionMenuItemV2
1602 \since 6.11
1603 \brief The QStyleOptionMenuItemV2 class enhances
1604 QStyleOptionMenuItem with new members.
1605
1606 \inmodule QtWidgets
1607*/
1608
1609/*!
1610 \fn QStyleOptionMenuItemV2::QStyleOptionMenuItemV2()
1611
1612 Constructs a QStyleOptionMenuItemV2, initializing the members
1613 variables to their default values.
1614*/
1615
1616/*!
1617 \fn QStyleOptionMenuItemV2::QStyleOptionMenuItemV2(const QStyleOptionMenuItemV2 &other)
1618
1619 Constructs a copy of the \a other style option.
1620*/
1621
1622/*!
1623 \internal
1624*/
1625QStyleOptionMenuItemV2::QStyleOptionMenuItemV2(int version)
1626 : QStyleOptionMenuItem(version),
1627 mouseDown{false},
1628 unused{0}
1629{}
1630
1631/*!
1632 \variable QStyleOptionMenuItemV2::mouseDown
1633 \brief true when the mouse is pressed down.
1634
1635 This is needed because there is no differentation between
1636 a pressed and a sunken state when QStyle::State_Sunken is set.
1637 QStyle::State_Sunken is also set when the menu is open
1638 (i.e. showing the popup menu)
1639*/
1640
1641/*!
1642 \class QStyleOptionMenuItem
1643 \brief The QStyleOptionMenuItem class is used to describe the
1644 parameter necessary for drawing a menu item.
1645
1646 \inmodule QtWidgets
1647
1648 QStyleOptionMenuItem contains all the information that QStyle
1649 functions need to draw the menu items from \l QMenu. It is also
1650 used for drawing other menu-related widgets.
1651
1652 For performance reasons, there are few member functions and the
1653 access to the member variables is direct (i.e., using the \c . or
1654 \c -> operator). This makes the structures straightforward to use
1655 and emphasizes that these are simply parameters used by the style
1656 functions.
1657
1658 \sa QStyleOption
1659*/
1660
1661/*!
1662 Constructs a QStyleOptionMenuItem, initializing the members
1663 variables to their default values.
1664*/
1665
1666QStyleOptionMenuItem::QStyleOptionMenuItem()
1667 : QStyleOptionMenuItem(QStyleOptionMenuItem::Version)
1668{
1669}
1670
1671/*!
1672 \internal
1673*/
1674QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
1675 : QStyleOption(version, SO_MenuItem), menuItemType(Normal),
1676 checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0),
1677 reservedShortcutWidth(0)
1678{
1679}
1680
1681/*!
1682 \fn QStyleOptionMenuItem::QStyleOptionMenuItem(const QStyleOptionMenuItem &other)
1683
1684 Constructs a copy of the \a other style option.
1685*/
1686
1687/*!
1688 \enum QStyleOptionMenuItem::StyleOptionType
1689
1690 This enum is used to hold information about the type of the style option, and
1691 is defined for each QStyleOption subclass.
1692
1693 \value Type The type of style option provided (\l{SO_MenuItem} for this class).
1694
1695 The type is used internally by QStyleOption, its subclasses, and
1696 qstyleoption_cast() to determine the type of style option. In
1697 general you do not need to worry about this unless you want to
1698 create your own QStyleOption subclass and your own styles.
1699
1700 \sa StyleOptionVersion
1701*/
1702
1703/*!
1704 \enum QStyleOptionMenuItem::StyleOptionVersion
1705
1706 This enum is used to hold information about the version of the style option, and
1707 is defined for each QStyleOption subclass.
1708
1709 \value Version 1
1710
1711 The version is used by QStyleOption subclasses to implement
1712 extensions without breaking compatibility. If you use
1713 qstyleoption_cast(), you normally do not need to check it.
1714
1715 \sa StyleOptionType
1716*/
1717
1718/*!
1719 \enum QStyleOptionMenuItem::MenuItemType
1720
1721 This enum indicates the type of menu item that the structure describes.
1722
1723 \value Normal A normal menu item.
1724 \value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction().
1725 \value Separator A menu separator.
1726 \value SubMenu Indicates the menu item points to a sub-menu.
1727 \value Scroller A popup menu scroller (currently only used on \macos).
1728 \value TearOff A tear-off handle for the menu.
1729 \value Margin Deprecated and not used. The margin of the menu.
1730 \value EmptyArea The empty area of the menu.
1731
1732 \sa menuItemType
1733*/
1734
1735/*!
1736 \enum QStyleOptionMenuItem::CheckType
1737
1738 This enum is used to indicate whether or not a check mark should be
1739 drawn for the item, or even if it should be drawn at all.
1740
1741 \value NotCheckable The item is not checkable.
1742 \value Exclusive The item is an exclusive check item (like a radio button).
1743 \value NonExclusive The item is a non-exclusive check item (like a check box).
1744
1745 \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy
1746*/
1747
1748/*!
1749 \variable QStyleOptionMenuItem::menuItemType
1750 \brief the type of menu item
1751
1752 The default value is \l Normal.
1753
1754 \sa MenuItemType
1755*/
1756
1757/*!
1758 \variable QStyleOptionMenuItem::checkType
1759 \brief the type of checkmark of the menu item
1760
1761 The default value is \l NotCheckable.
1762
1763 \sa CheckType
1764*/
1765
1766/*!
1767 \variable QStyleOptionMenuItem::checked
1768 \brief whether the menu item is checked or not
1769
1770 The default value is false.
1771*/
1772
1773/*!
1774 \variable QStyleOptionMenuItem::menuHasCheckableItems
1775 \brief whether the menu as a whole has checkable items or not
1776
1777 The default value is true.
1778
1779 If this option is set to false, then the menu has no checkable
1780 items. This makes it possible for GUI styles to save some
1781 horizontal space that would normally be used for the check column.
1782*/
1783
1784/*!
1785 \variable QStyleOptionMenuItem::menuRect
1786 \brief the rectangle for the entire menu
1787
1788 The default value is a null rectangle, i.e. a rectangle with both
1789 the width and the height set to 0.
1790*/
1791
1792/*!
1793 \variable QStyleOptionMenuItem::text
1794 \brief the text for the menu item
1795
1796 Note that the text format is something like this "Menu
1797 text\b{\\t}Shortcut".
1798
1799 If the menu item doesn't have a shortcut, it will just contain the
1800 menu item's text. The default value is an empty string.
1801*/
1802
1803/*!
1804 \variable QStyleOptionMenuItem::icon
1805 \brief the icon for the menu item
1806
1807 The default value is an empty icon, i.e. an icon with neither a
1808 pixmap nor a filename.
1809*/
1810
1811/*!
1812 \variable QStyleOptionMenuItem::maxIconWidth
1813 \brief the maximum icon width for the icon in the menu item
1814
1815 This can be used for drawing the icon into the correct place or
1816 properly aligning items. The variable must be set regardless of
1817 whether or not the menu item has an icon. The default value is 0.
1818*/
1819
1820/*!
1821 \variable QStyleOptionMenuItem::reservedShortcutWidth
1822 \brief the reserved width for the menu item's shortcut
1823
1824 QMenu sets it to the width occupied by the widest shortcut among
1825 all visible items within the menu.
1826
1827 The default value is 0.
1828*/
1829
1830
1831/*!
1832 \variable QStyleOptionMenuItem::font
1833 \brief the font used for the menu item text
1834
1835 This is the font that should be used for drawing the menu text
1836 minus the shortcut. The shortcut is usually drawn using the
1837 painter's font. By default, the application's default font is
1838 used.
1839*/
1840
1841/*!
1842 \class QStyleOptionComplex
1843 \brief The QStyleOptionComplex class is used to hold parameters that are
1844 common to all complex controls.
1845
1846 \inmodule QtWidgets
1847
1848 This class is not used on its own. Instead it is used to derive
1849 other complex control options, for example QStyleOptionSlider and
1850 QStyleOptionSpinBox.
1851
1852 For performance reasons, there are few member functions and the
1853 access to the member variables is direct (i.e., using the \c . or
1854 \c -> operator). This makes the structures straightforward to use
1855 and emphasizes that these are simply parameters used by the style
1856 functions.
1857
1858 \sa QStyleOption
1859*/
1860
1861/*!
1862 Constructs a QStyleOptionComplex of the specified \a type and \a
1863 version, initializing the member variables to their default
1864 values. This constructor is usually called by subclasses.
1865*/
1866
1867QStyleOptionComplex::QStyleOptionComplex(int version, int type)
1868 : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None)
1869{
1870}
1871
1872/*!
1873 \fn QStyleOptionComplex::QStyleOptionComplex(const QStyleOptionComplex &other)
1874
1875 Constructs a copy of the \a other style option.
1876*/
1877
1878/*!
1879 \enum QStyleOptionComplex::StyleOptionType
1880
1881 This enum is used to hold information about the type of the style option, and
1882 is defined for each QStyleOption subclass.
1883
1884 \value Type The type of style option provided (\l{SO_Complex} for this class).
1885
1886 The type is used internally by QStyleOption, its subclasses, and
1887 qstyleoption_cast() to determine the type of style option. In
1888 general you do not need to worry about this unless you want to
1889 create your own QStyleOption subclass and your own styles.
1890
1891 \sa StyleOptionVersion
1892*/
1893
1894/*!
1895 \enum QStyleOptionComplex::StyleOptionVersion
1896
1897 This enum is used to hold information about the version of the style option, and
1898 is defined for each QStyleOption subclass.
1899
1900 \value Version 1
1901
1902 The version is used by QStyleOption subclasses to implement
1903 extensions without breaking compatibility. If you use
1904 qstyleoption_cast(), you normally do not need to check it.
1905
1906 \sa StyleOptionType
1907*/
1908
1909/*!
1910 \variable QStyleOptionComplex::subControls
1911
1912 This variable holds a bitwise OR of the \l{QStyle::SubControl}
1913 {sub-controls} to be drawn for the complex control.
1914
1915 The default value is QStyle::SC_All.
1916
1917 \sa QStyle::SubControl
1918*/
1919
1920/*!
1921 \variable QStyleOptionComplex::activeSubControls
1922
1923 This variable holds a bitwise OR of the \l{QStyle::SubControl}
1924 {sub-controls} that are active for the complex control.
1925
1926 The default value is QStyle::SC_None.
1927
1928 \sa QStyle::SubControl
1929*/
1930
1931#if QT_CONFIG(slider)
1932/*!
1933 \class QStyleOptionSlider
1934 \brief The QStyleOptionSlider class is used to describe the
1935 parameters needed for drawing a slider.
1936
1937 \inmodule QtWidgets
1938
1939 QStyleOptionSlider contains all the information that QStyle
1940 functions need to draw QSlider and QScrollBar.
1941
1942 For performance reasons, there are few member functions and the
1943 access to the member variables is direct (i.e., using the \c . or
1944 \c -> operator). This makes the structures straightforward to use
1945 and emphasizes that these are simply parameters used by the style
1946 functions.
1947
1948 \sa QStyleOptionComplex, QSlider, QScrollBar
1949*/
1950
1951/*!
1952 Constructs a QStyleOptionSlider, initializing the members
1953 variables to their default values.
1954*/
1955
1956QStyleOptionSlider::QStyleOptionSlider()
1957 : QStyleOptionSlider(Version)
1958{
1959}
1960
1961/*!
1962 \internal
1963*/
1964QStyleOptionSlider::QStyleOptionSlider(int version)
1965 : QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
1966 tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
1967 sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
1968 dialWrapping(false), keyboardModifiers{}
1969{
1970}
1971
1972/*!
1973 \fn QStyleOptionSlider::QStyleOptionSlider(const QStyleOptionSlider &other)
1974
1975 Constructs a copy of the \a other style option.
1976*/
1977
1978/*!
1979 \enum QStyleOptionSlider::StyleOptionType
1980
1981 This enum is used to hold information about the type of the style option, and
1982 is defined for each QStyleOption subclass.
1983
1984 \value Type The type of style option provided (\l{SO_Slider} for this class).
1985
1986 The type is used internally by QStyleOption, its subclasses, and
1987 qstyleoption_cast() to determine the type of style option. In
1988 general you do not need to worry about this unless you want to
1989 create your own QStyleOption subclass and your own styles.
1990
1991 \sa StyleOptionVersion
1992*/
1993
1994/*!
1995 \enum QStyleOptionSlider::StyleOptionVersion
1996
1997 This enum is used to hold information about the version of the style option, and
1998 is defined for each QStyleOption subclass.
1999
2000 \value Version 1
2001
2002 The version is used by QStyleOption subclasses to implement
2003 extensions without breaking compatibility. If you use
2004 qstyleoption_cast(), you normally do not need to check it.
2005
2006 \sa StyleOptionType
2007*/
2008
2009/*!
2010 \variable QStyleOptionSlider::orientation
2011 \brief the slider's orientation (horizontal or vertical)
2012
2013 The default orientation is Qt::Horizontal.
2014
2015 \sa Qt::Orientation
2016*/
2017
2018/*!
2019 \variable QStyleOptionSlider::minimum
2020 \brief the minimum value for the slider
2021
2022 The default value is 0.
2023*/
2024
2025/*!
2026 \variable QStyleOptionSlider::maximum
2027 \brief the maximum value for the slider
2028
2029 The default value is 0.
2030*/
2031
2032/*!
2033 \variable QStyleOptionSlider::tickPosition
2034 \brief the position of the slider's tick marks, if any
2035
2036 The default value is QSlider::NoTicks.
2037
2038 \sa QSlider::TickPosition
2039*/
2040
2041/*!
2042 \variable QStyleOptionSlider::tickInterval
2043 \brief the interval that should be drawn between tick marks
2044
2045 The default value is 0.
2046*/
2047
2048/*!
2049 \variable QStyleOptionSlider::notchTarget
2050 \brief the number of pixel between notches
2051
2052 The default value is 0.0.
2053
2054 \sa QDial::notchTarget()
2055*/
2056
2057/*!
2058 \variable QStyleOptionSlider::dialWrapping
2059 \brief whether the dial should wrap or not
2060
2061 The default value is false, i.e. the dial is not wrapped.
2062
2063 \sa QDial::wrapping()
2064*/
2065
2066/*!
2067 \variable QStyleOptionSlider::upsideDown
2068 \brief the slider control orientation
2069
2070 Normally a slider increases as it moves up or to the right;
2071 upsideDown indicates that it should do the opposite (increase as
2072 it moves down or to the left). The default value is false,
2073 i.e. the slider increases as it moves up or to the right.
2074
2075 \sa QStyle::sliderPositionFromValue(),
2076 QStyle::sliderValueFromPosition(),
2077 QAbstractSlider::invertedAppearance
2078*/
2079
2080/*!
2081 \variable QStyleOptionSlider::sliderPosition
2082 \brief the position of the slider handle
2083
2084 If the slider has active feedback (i.e.,
2085 QAbstractSlider::tracking is true), this value will be the same as
2086 \l sliderValue. Otherwise, it will have the current position of
2087 the handle. The default value is 0.
2088
2089 \sa QAbstractSlider::tracking, sliderValue
2090*/
2091
2092/*!
2093 \variable QStyleOptionSlider::sliderValue
2094 \brief the value of the slider
2095
2096 If the slider has active feedback (i.e.,
2097 QAbstractSlider::tracking is true), this value will be the same
2098 as \l sliderPosition. Otherwise, it will have the value the
2099 slider had before the mouse was pressed.
2100
2101 The default value is 0.
2102
2103 \sa QAbstractSlider::tracking, sliderPosition
2104*/
2105
2106/*!
2107 \variable QStyleOptionSlider::singleStep
2108 \brief the size of the single step of the slider
2109
2110 The default value is 0.
2111
2112 \sa QAbstractSlider::singleStep
2113*/
2114
2115/*!
2116 \variable QStyleOptionSlider::pageStep
2117 \brief the size of the page step of the slider
2118
2119 The default value is 0.
2120
2121 \sa QAbstractSlider::pageStep
2122*/
2123#endif // QT_CONFIG(slider)
2124
2125#if QT_CONFIG(spinbox)
2126/*!
2127 \class QStyleOptionSpinBox
2128 \brief The QStyleOptionSpinBox class is used to describe the
2129 parameters necessary for drawing a spin box.
2130
2131 \inmodule QtWidgets
2132
2133 QStyleOptionSpinBox contains all the information that QStyle
2134 functions need to draw QSpinBox and QDateTimeEdit.
2135
2136 For performance reasons, there are few member functions and the
2137 access to the member variables is direct (i.e., using the \c . or
2138 \c -> operator). This makes the structures straightforward to use
2139 and emphasizes that these are simply parameters used by the style
2140 functions.
2141
2142 \sa QStyleOption, QStyleOptionComplex
2143*/
2144
2145/*!
2146 Constructs a QStyleOptionSpinBox, initializing the members
2147 variables to their default values.
2148*/
2149
2150QStyleOptionSpinBox::QStyleOptionSpinBox()
2151 : QStyleOptionSpinBox(Version)
2152{
2153}
2154
2155/*!
2156 \internal
2157*/
2158QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
2159 : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
2160 stepEnabled(QAbstractSpinBox::StepNone), frame(false)
2161{
2162}
2163
2164/*!
2165 \fn QStyleOptionSpinBox::QStyleOptionSpinBox(const QStyleOptionSpinBox &other)
2166
2167 Constructs a copy of the \a other style option.
2168*/
2169
2170/*!
2171 \enum QStyleOptionSpinBox::StyleOptionType
2172
2173 This enum is used to hold information about the type of the style option, and
2174 is defined for each QStyleOption subclass.
2175
2176 \value Type The type of style option provided (\l{SO_SpinBox} for this class).
2177
2178 The type is used internally by QStyleOption, its subclasses, and
2179 qstyleoption_cast() to determine the type of style option. In
2180 general you do not need to worry about this unless you want to
2181 create your own QStyleOption subclass and your own styles.
2182
2183 \sa StyleOptionVersion
2184*/
2185
2186/*!
2187 \enum QStyleOptionSpinBox::StyleOptionVersion
2188
2189 This enum is used to hold information about the version of the style option, and
2190 is defined for each QStyleOption subclass.
2191
2192 \value Version 1
2193
2194 The version is used by QStyleOption subclasses to implement
2195 extensions without breaking compatibility. If you use
2196 qstyleoption_cast(), you normally do not need to check it.
2197
2198 \sa StyleOptionType
2199*/
2200
2201/*!
2202 \variable QStyleOptionSpinBox::buttonSymbols
2203 \brief the type of button symbols to draw for the spin box
2204
2205 The default value is QAbstractSpinBox::UpDownArrows specufying
2206 little arrows in the classic style.
2207
2208 \sa QAbstractSpinBox::ButtonSymbols
2209*/
2210
2211/*!
2212 \variable QStyleOptionSpinBox::stepEnabled
2213 \brief which buttons of the spin box that are enabled
2214
2215 The default value is QAbstractSpinBox::StepNone.
2216
2217 \sa QAbstractSpinBox::StepEnabled
2218*/
2219
2220/*!
2221 \variable QStyleOptionSpinBox::frame
2222 \brief whether the spin box has a frame
2223
2224 The default value is false, i.e. the spin box has no frame.
2225*/
2226#endif // QT_CONFIG(spinbox)
2227
2228/*!
2229 \class QStyleOptionDockWidget
2230 \brief The QStyleOptionDockWidget class is used to describe the
2231 parameters for drawing a dock widget.
2232
2233 \inmodule QtWidgets
2234
2235 QStyleOptionDockWidget contains all the information that QStyle
2236 functions need to draw graphical elements like QDockWidget.
2237
2238 For performance reasons, there are few member functions and the
2239 access to the member variables is direct (i.e., using the \c . or
2240 \c -> operator). This makes the structures straightforward to use
2241 and emphasizes that these are simply parameters used by the style
2242 functions.
2243
2244 \sa QStyleOption
2245*/
2246
2247/*!
2248 Constructs a QStyleOptionDockWidget, initializing the member
2249 variables to their default values.
2250*/
2251
2252QStyleOptionDockWidget::QStyleOptionDockWidget()
2253 : QStyleOptionDockWidget(Version)
2254{
2255}
2256
2257/*!
2258 \internal
2259*/
2260QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
2261 : QStyleOption(version, SO_DockWidget), closable(false),
2262 movable(false), floatable(false), verticalTitleBar(false)
2263{
2264}
2265
2266/*!
2267 \fn QStyleOptionDockWidget::QStyleOptionDockWidget(const QStyleOptionDockWidget &other)
2268
2269 Constructs a copy of the \a other style option.
2270*/
2271
2272/*!
2273 \enum QStyleOptionDockWidget::StyleOptionType
2274
2275 This enum is used to hold information about the type of the style option, and
2276 is defined for each QStyleOption subclass.
2277
2278 \value Type The type of style option provided (\l{SO_DockWidget} for this class).
2279
2280 The type is used internally by QStyleOption, its subclasses, and
2281 qstyleoption_cast() to determine the type of style option. In
2282 general you do not need to worry about this unless you want to
2283 create your own QStyleOption subclass and your own styles.
2284
2285 \sa StyleOptionVersion
2286*/
2287
2288/*!
2289 \enum QStyleOptionDockWidget::StyleOptionVersion
2290
2291 This enum is used to hold information about the version of the style option, and
2292 is defined for each QStyleOption subclass.
2293
2294 \value Version 2
2295
2296 The version is used by QStyleOption subclasses to implement
2297 extensions without breaking compatibility. If you use
2298 qstyleoption_cast(), you normally do not need to check it.
2299
2300 \sa StyleOptionType
2301*/
2302
2303/*!
2304 \variable QStyleOptionDockWidget::title
2305 \brief the title of the dock window
2306
2307 The default value is an empty string.
2308*/
2309
2310/*!
2311 \variable QStyleOptionDockWidget::closable
2312 \brief whether the dock window is closable
2313
2314 The default value is true.
2315*/
2316
2317/*!
2318 \variable QStyleOptionDockWidget::movable
2319 \brief whether the dock window is movable
2320
2321 The default value is false.
2322*/
2323
2324/*!
2325 \variable QStyleOptionDockWidget::floatable
2326 \brief whether the dock window is floatable
2327
2328 The default value is true.
2329*/
2330
2331#if QT_CONFIG(toolbutton)
2332/*!
2333 \class QStyleOptionToolButton
2334 \brief The QStyleOptionToolButton class is used to describe the
2335 parameters for drawing a tool button.
2336
2337 \inmodule QtWidgets
2338
2339 QStyleOptionToolButton contains all the information that QStyle
2340 functions need to draw QToolButton.
2341
2342 For performance reasons, there are few member functions and the
2343 access to the member variables is direct (i.e., using the \c . or
2344 \c -> operator). This makes the structures straightforward to use
2345 and emphasizes that these are simply parameters used by the style
2346 functions.
2347
2348 \sa QStyleOption, QStyleOptionComplex, QStyleOptionButton
2349*/
2350
2351/*!
2352 \enum QStyleOptionToolButton::ToolButtonFeature
2353 Describes the various features that a tool button can have.
2354
2355 \value None A normal tool button.
2356 \value Arrow The tool button is an arrow.
2357 \value Menu The tool button has a menu.
2358 \value PopupDelay There is a delay to showing the menu.
2359 \value HasMenu The button has a popup menu.
2360 \value MenuButtonPopup The button should display an arrow to
2361 indicate that a menu is present.
2362
2363 \sa features, QToolButton::toolButtonStyle(), QToolButton::popupMode()
2364*/
2365
2366/*!
2367 Constructs a QStyleOptionToolButton, initializing the members
2368 variables to their default values.
2369*/
2370
2371QStyleOptionToolButton::QStyleOptionToolButton()
2372 : QStyleOptionToolButton(Version)
2373{
2374}
2375
2376/*!
2377 \internal
2378*/
2379QStyleOptionToolButton::QStyleOptionToolButton(int version)
2380 : QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
2381 , toolButtonStyle(Qt::ToolButtonIconOnly)
2382
2383{
2384}
2385
2386/*!
2387 \fn QStyleOptionToolButton::QStyleOptionToolButton(const QStyleOptionToolButton &other)
2388
2389 Constructs a copy of the \a other style option.
2390*/
2391
2392/*!
2393 \enum QStyleOptionToolButton::StyleOptionType
2394
2395 This enum is used to hold information about the type of the style option, and
2396 is defined for each QStyleOption subclass.
2397
2398 \value Type The type of style option provided (\l{SO_ToolButton} for this class).
2399
2400 The type is used internally by QStyleOption, its subclasses, and
2401 qstyleoption_cast() to determine the type of style option. In
2402 general you do not need to worry about this unless you want to
2403 create your own QStyleOption subclass and your own styles.
2404
2405 \sa StyleOptionVersion
2406*/
2407
2408/*!
2409 \enum QStyleOptionToolButton::StyleOptionVersion
2410
2411 This enum is used to hold information about the version of the style option, and
2412 is defined for each QStyleOption subclass.
2413
2414 \value Version 1
2415
2416 The version is used by QStyleOption subclasses to implement
2417 extensions without breaking compatibility. If you use
2418 qstyleoption_cast(), you normally do not need to check it.
2419
2420 \sa StyleOptionType
2421*/
2422
2423/*!
2424 \variable QStyleOptionToolButton::features
2425 \brief an OR combination of the tool button's features
2426
2427 The default value is \l None.
2428
2429 \sa ToolButtonFeature
2430*/
2431
2432/*!
2433 \variable QStyleOptionToolButton::icon
2434 \brief the icon for the tool button
2435
2436 The default value is an empty icon, i.e. an icon with neither a
2437 pixmap nor a filename.
2438
2439 \sa iconSize
2440*/
2441
2442/*!
2443 \variable QStyleOptionToolButton::iconSize
2444 \brief the size of the icon for the tool button
2445
2446 The default value is QSize(-1, -1), i.e. an invalid size.
2447*/
2448
2449/*!
2450 \variable QStyleOptionToolButton::text
2451 \brief the text of the tool button
2452
2453 This value is only used if toolButtonStyle is
2454 Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
2455 Qt::ToolButtonTextOnly. The default value is an empty string.
2456*/
2457
2458/*!
2459 \variable QStyleOptionToolButton::arrowType
2460 \brief the direction of the arrow for the tool button
2461
2462 This value is only used if \l features includes \l Arrow. The
2463 default value is Qt::DownArrow.
2464*/
2465
2466/*!
2467 \variable QStyleOptionToolButton::toolButtonStyle
2468 \brief a Qt::ToolButtonStyle value describing the appearance of
2469 the tool button
2470
2471 The default value is Qt::ToolButtonIconOnly.
2472
2473 \sa QToolButton::toolButtonStyle()
2474*/
2475
2476/*!
2477 \variable QStyleOptionToolButton::pos
2478 \brief the position of the tool button
2479
2480 The default value is a null point, i.e. (0, 0)
2481*/
2482
2483/*!
2484 \variable QStyleOptionToolButton::font
2485 \brief the font that is used for the text
2486
2487 This value is only used if toolButtonStyle is
2488 Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
2489 Qt::ToolButtonTextOnly. By default, the application's default font
2490 is used.
2491*/
2492#endif // QT_CONFIG(toolbutton)
2493
2494/*!
2495 \class QStyleOptionComboBox
2496 \brief The QStyleOptionComboBox class is used to describe the
2497 parameter for drawing a combobox.
2498
2499 \inmodule QtWidgets
2500
2501 QStyleOptionButton contains all the information that QStyle
2502 functions need to draw QComboBox.
2503
2504 For performance reasons, there are few member functions and the
2505 access to the member variables is direct (i.e., using the \c . or
2506 \c -> operator). This makes the structures straightforward to use
2507 and emphasizes that these are simply parameters used by the style
2508 functions.
2509
2510 \sa QStyleOption, QStyleOptionComplex, QComboBox
2511*/
2512
2513/*!
2514 Creates a QStyleOptionComboBox, initializing the members variables
2515 to their default values.
2516*/
2517
2518QStyleOptionComboBox::QStyleOptionComboBox()
2519 : QStyleOptionComboBox(Version)
2520{
2521}
2522
2523/*!
2524 \internal
2525*/
2526QStyleOptionComboBox::QStyleOptionComboBox(int version)
2527 : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true)
2528{
2529}
2530
2531/*!
2532 \fn QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)
2533
2534 Constructs a copy of the \a other style option.
2535*/
2536
2537/*!
2538 \enum QStyleOptionComboBox::StyleOptionType
2539
2540 This enum is used to hold information about the type of the style option, and
2541 is defined for each QStyleOption subclass.
2542
2543 \value Type The type of style option provided (\l{SO_ComboBox} for this class).
2544
2545 The type is used internally by QStyleOption, its subclasses, and
2546 qstyleoption_cast() to determine the type of style option. In
2547 general you do not need to worry about this unless you want to
2548 create your own QStyleOption subclass and your own styles.
2549
2550 \sa StyleOptionVersion
2551*/
2552
2553/*!
2554 \enum QStyleOptionComboBox::StyleOptionVersion
2555
2556 This enum is used to hold information about the version of the style option, and
2557 is defined for each QStyleOption subclass.
2558
2559 \value Version 2
2560
2561 The version is used by QStyleOption subclasses to implement
2562 extensions without breaking compatibility. If you use
2563 qstyleoption_cast(), you normally do not need to check it.
2564
2565 \sa StyleOptionType
2566*/
2567
2568/*!
2569 \variable QStyleOptionComboBox::editable
2570 \brief whether or not the combobox is editable or not
2571
2572 the default
2573 value is false
2574
2575 \sa QComboBox::isEditable()
2576*/
2577
2578
2579/*!
2580 \variable QStyleOptionComboBox::frame
2581 \brief whether the combo box has a frame
2582
2583 The default value is true.
2584*/
2585
2586/*!
2587 \variable QStyleOptionComboBox::currentText
2588 \brief the text for the current item of the combo box
2589
2590 The default value is an empty string.
2591*/
2592
2593/*!
2594 \variable QStyleOptionComboBox::currentIcon
2595 \brief the icon for the current item of the combo box
2596
2597 The default value is an empty icon, i.e. an icon with neither a
2598 pixmap nor a filename.
2599*/
2600
2601/*!
2602 \variable QStyleOptionComboBox::iconSize
2603 \brief the icon size for the current item of the combo box
2604
2605 The default value is QSize(-1, -1), i.e. an invalid size.
2606*/
2607
2608/*!
2609 \variable QStyleOptionComboBox::popupRect
2610 \brief the popup rectangle for the combobox
2611
2612 The default value is a null rectangle, i.e. a rectangle with both
2613 the width and the height set to 0.
2614
2615 This variable is currently unused. You can safely ignore it.
2616
2617 \sa QStyle::SC_ComboBoxListBoxPopup
2618*/
2619
2620/*!
2621 \variable QStyleOptionComboBox::textAlignment
2622 \brief the alignment of the current text in the combo box
2623
2624 The default value is Qt::AlignLeft | Qt::AlignVCenter.
2625*/
2626
2627/*!
2628 \class QStyleOptionToolBox
2629 \brief The QStyleOptionToolBox class is used to describe the
2630 parameters needed for drawing a tool box.
2631
2632 \inmodule QtWidgets
2633
2634 QStyleOptionToolBox contains all the information that QStyle
2635 functions need to draw QToolBox.
2636
2637 For performance reasons, there are few member functions and the
2638 access to the member variables is direct (i.e., using the \c . or
2639 \c -> operator). This makes the structures straightforward to use
2640 and emphasizes that these are simply parameters used by the style
2641 functions.
2642
2643 \sa QStyleOption, QToolBox
2644*/
2645
2646/*!
2647 Creates a QStyleOptionToolBox, initializing the members variables
2648 to their default values.
2649*/
2650
2651QStyleOptionToolBox::QStyleOptionToolBox()
2652 : QStyleOptionToolBox(Version)
2653{
2654}
2655
2656/*!
2657 \internal
2658*/
2659QStyleOptionToolBox::QStyleOptionToolBox(int version)
2660 : QStyleOption(version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent)
2661{
2662}
2663
2664/*!
2665 \fn QStyleOptionToolBox::QStyleOptionToolBox(const QStyleOptionToolBox &other)
2666
2667 Constructs a copy of the \a other style option.
2668*/
2669
2670/*!
2671 \enum QStyleOptionToolBox::StyleOptionType
2672
2673 This enum is used to hold information about the type of the style option, and
2674 is defined for each QStyleOption subclass.
2675
2676 \value Type The type of style option provided (\l{SO_ToolBox} for this class).
2677
2678 The type is used internally by QStyleOption, its subclasses, and
2679 qstyleoption_cast() to determine the type of style option. In
2680 general you do not need to worry about this unless you want to
2681 create your own QStyleOption subclass and your own styles.
2682
2683 \sa StyleOptionVersion
2684*/
2685
2686/*!
2687 \enum QStyleOptionToolBox::StyleOptionVersion
2688
2689 This enum is used to hold information about the version of the style option, and
2690 is defined for each QStyleOption subclass.
2691
2692 \value Version 2
2693
2694 The version is used by QStyleOption subclasses to implement
2695 extensions without breaking compatibility. If you use
2696 qstyleoption_cast(), you normally do not need to check it.
2697
2698 \sa StyleOptionType
2699*/
2700
2701/*!
2702 \variable QStyleOptionToolBox::icon
2703 \brief the icon for the tool box tab
2704
2705 The default value is an empty icon, i.e. an icon with neither a
2706 pixmap nor a filename.
2707*/
2708
2709/*!
2710 \variable QStyleOptionToolBox::text
2711 \brief the text for the tool box tab
2712
2713 The default value is an empty string.
2714*/
2715
2716/*!
2717 \enum QStyleOptionToolBox::SelectedPosition
2718
2719 This enum describes the position of the selected tab. Some styles
2720 need to draw a tab differently depending on whether or not it is
2721 adjacent to the selected tab.
2722
2723 \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
2724 \value NextIsSelected The next tab (typically the tab on the right) is selected.
2725 \value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
2726
2727 \sa selectedPosition
2728*/
2729
2730/*!
2731 \enum QStyleOptionToolBox::TabPosition
2732
2733 This enum describes tab positions relative to other tabs.
2734
2735 \value Beginning The tab is the first (i.e., top-most) tab in
2736 the toolbox.
2737 \value Middle The tab is placed in the middle of the toolbox.
2738 \value End The tab is placed at the bottom of the toolbox.
2739 \value OnlyOneTab There is only one tab in the toolbox.
2740*/
2741
2742/*!
2743 \variable QStyleOptionToolBox::selectedPosition
2744 \brief the position of the selected tab in relation to this tab
2745
2746 The default value is NotAdjacent, i.e. the tab is not adjacent to
2747 a selected tab nor is it the selected tab.
2748*/
2749
2750#if QT_CONFIG(rubberband)
2751/*!
2752 \class QStyleOptionRubberBand
2753 \brief The QStyleOptionRubberBand class is used to describe the
2754 parameters needed for drawing a rubber band.
2755
2756 \inmodule QtWidgets
2757
2758 QStyleOptionRubberBand contains all the information that
2759 QStyle functions need to draw QRubberBand.
2760
2761 For performance reasons, there are few member functions and the
2762 access to the member variables is direct (i.e., using the \c . or
2763 \c -> operator). This makes the structures straightforward to use
2764 and emphasizes that these are simply parameters used by the style
2765 functions.
2766
2767 \sa QStyleOption, QRubberBand
2768*/
2769
2770/*!
2771 Creates a QStyleOptionRubberBand, initializing the members
2772 variables to their default values.
2773*/
2774
2775QStyleOptionRubberBand::QStyleOptionRubberBand()
2776 : QStyleOptionRubberBand(Version)
2777{
2778}
2779
2780/*!
2781 \internal
2782*/
2783QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
2784 : QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
2785{
2786}
2787
2788/*!
2789 \fn QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other)
2790
2791 Constructs a copy of the \a other style option.
2792*/
2793
2794/*!
2795 \enum QStyleOptionRubberBand::StyleOptionType
2796
2797 This enum is used to hold information about the type of the style option, and
2798 is defined for each QStyleOption subclass.
2799
2800 \value Type The type of style option provided (\l{SO_RubberBand} for this class).
2801
2802 The type is used internally by QStyleOption, its subclasses, and
2803 qstyleoption_cast() to determine the type of style option. In
2804 general you do not need to worry about this unless you want to
2805 create your own QStyleOption subclass and your own styles.
2806
2807 \sa StyleOptionVersion
2808*/
2809
2810/*!
2811 \enum QStyleOptionRubberBand::StyleOptionVersion
2812
2813 This enum is used to hold information about the version of the style option, and
2814 is defined for each QStyleOption subclass.
2815
2816 \value Version 1
2817
2818 The version is used by QStyleOption subclasses to implement
2819 extensions without breaking compatibility. If you use
2820 qstyleoption_cast(), you normally do not need to check it.
2821
2822 \sa StyleOptionType
2823*/
2824
2825/*!
2826 \variable QStyleOptionRubberBand::shape
2827 \brief the shape of the rubber band
2828
2829 The default shape is QRubberBand::Line.
2830*/
2831
2832/*!
2833 \variable QStyleOptionRubberBand::opaque
2834 \brief whether the rubber band is required to be drawn in an opaque style
2835
2836 The default value is true.
2837*/
2838#endif // QT_CONFIG(rubberband)
2839
2840/*!
2841 \class QStyleOptionTitleBar
2842 \brief The QStyleOptionTitleBar class is used to describe the
2843 parameters for drawing a title bar.
2844
2845 \inmodule QtWidgets
2846
2847 QStyleOptionTitleBar contains all the information that QStyle
2848 functions need to draw the title bar of a QMdiSubWindow.
2849
2850 For performance reasons, there are few member functions and the
2851 access to the member variables is direct (i.e., using the \c . or
2852 \c -> operator). This makes the structures straightforward to use
2853 and emphasizes that these are simply parameters used by the style
2854 functions.
2855
2856 \sa QStyleOption, QStyleOptionComplex, QMdiSubWindow
2857*/
2858
2859/*!
2860 Constructs a QStyleOptionTitleBar, initializing the members
2861 variables to their default values.
2862*/
2863
2864QStyleOptionTitleBar::QStyleOptionTitleBar()
2865 : QStyleOptionTitleBar(Version)
2866{
2867}
2868
2869/*!
2870 \fn QStyleOptionTitleBar::QStyleOptionTitleBar(const QStyleOptionTitleBar &other)
2871
2872 Constructs a copy of the \a other style option.
2873*/
2874
2875/*!
2876 \enum QStyleOptionTitleBar::StyleOptionType
2877
2878 This enum is used to hold information about the type of the style option, and
2879 is defined for each QStyleOption subclass.
2880
2881 \value Type The type of style option provided (\l{SO_TitleBar} for this class).
2882
2883 The type is used internally by QStyleOption, its subclasses, and
2884 qstyleoption_cast() to determine the type of style option. In
2885 general you do not need to worry about this unless you want to
2886 create your own QStyleOption subclass and your own styles.
2887
2888 \sa StyleOptionVersion
2889*/
2890
2891/*!
2892 \enum QStyleOptionTitleBar::StyleOptionVersion
2893
2894 This enum is used to hold information about the version of the style option, and
2895 is defined for each QStyleOption subclass.
2896
2897 \value Version 1
2898
2899 The version is used by QStyleOption subclasses to implement
2900 extensions without breaking compatibility. If you use
2901 qstyleoption_cast(), you normally do not need to check it.
2902
2903 \sa StyleOptionType
2904*/
2905
2906/*!
2907 \internal
2908*/
2909QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
2910 : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0)
2911{
2912}
2913
2914
2915/*!
2916 \variable QStyleOptionTitleBar::text
2917 \brief the text of the title bar
2918
2919 The default value is an empty string.
2920*/
2921
2922/*!
2923 \variable QStyleOptionTitleBar::icon
2924 \brief the icon for the title bar
2925
2926 The default value is an empty icon, i.e. an icon with neither a
2927 pixmap nor a filename.
2928*/
2929
2930/*!
2931 \variable QStyleOptionTitleBar::titleBarState
2932 \brief the state of the title bar
2933
2934 This is basically the window state of the underlying widget. The
2935 default value is 0.
2936
2937 \sa QWidget::windowState()
2938*/
2939
2940/*!
2941 \variable QStyleOptionTitleBar::titleBarFlags
2942 \brief the widget flags for the title bar
2943
2944 The default value is Qt::Widget.
2945
2946 \sa Qt::WindowFlags
2947*/
2948
2949#if QT_CONFIG(itemviews)
2950/*!
2951 \class QStyleOptionViewItem
2952 \brief The QStyleOptionViewItem class is used to describe the
2953 parameters used to draw an item in a view widget.
2954
2955 \inmodule QtWidgets
2956
2957 QStyleOptionViewItem contains all the information that QStyle
2958 functions need to draw the items for Qt's model/view classes.
2959
2960 For performance reasons, there are few member functions and the
2961 access to the member variables is direct (i.e., using the \c . or
2962 \c -> operator). This makes the structures straightforward to use
2963 and emphasizes that these are simply parameters used by the style
2964 functions.
2965
2966 \sa QStyleOption, {model-view-programming.html}{Model/View
2967 Programming}
2968*/
2969
2970/*!
2971 \enum QStyleOptionViewItem::Position
2972
2973 This enum describes the position of the item's decoration.
2974
2975 \value Left On the left of the text.
2976 \value Right On the right of the text.
2977 \value Top Above the text.
2978 \value Bottom Below the text.
2979
2980 \sa decorationPosition
2981*/
2982
2983/*!
2984 \variable QStyleOptionViewItem::showDecorationSelected
2985 \brief whether the decoration should be highlighted on selected
2986 items
2987
2988 If this option is true, the branch and any decorations on selected items
2989 should be highlighted, indicating that the item is selected; otherwise, no
2990 highlighting is required. The default value is false.
2991
2992 \sa QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView
2993*/
2994
2995/*!
2996 \variable QStyleOptionViewItem::locale
2997 \brief the locale to use for displaying text, numbers and dates.
2998
2999 This allows the style to display e.g. dates in a different locale than
3000 the default locale of the application.
3001*/
3002
3003/*!
3004 \variable QStyleOptionViewItem::widget
3005 \brief the parent widget of the item
3006
3007 This member contains the parent widget (itemview) of the item to
3008 be able to e.g. access some properties within the QStyledItemDelegate
3009 methods.
3010*/
3011
3012/*!
3013 \variable QStyleOptionViewItem::textElideMode
3014 \brief where ellipsis should be added for text that is too long to fit
3015 into an item
3016
3017 The default value is Qt::ElideMiddle, i.e. the ellipsis appears in
3018 the middle of the text.
3019
3020 \sa Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation
3021*/
3022
3023/*!
3024 Constructs a QStyleOptionViewItem, initializing the members
3025 variables to their default values.
3026*/
3027
3028QStyleOptionViewItem::QStyleOptionViewItem()
3029 : QStyleOptionViewItem(Version)
3030{
3031}
3032
3033/*!
3034 \internal
3035*/
3036QStyleOptionViewItem::QStyleOptionViewItem(int version)
3037 : QStyleOption(version, SO_ViewItem),
3038 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
3039 textElideMode(Qt::ElideMiddle), decorationPosition(Left),
3040 showDecorationSelected(false), features(None), widget(nullptr),
3041 checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid)
3042{
3043}
3044
3045/*!
3046 \fn QStyleOptionViewItem::QStyleOptionViewItem(const QStyleOptionViewItem &other)
3047
3048 Constructs a copy of the \a other style option.
3049*/
3050
3051/*!
3052 \enum QStyleOptionViewItem::StyleOptionType
3053
3054 This enum is used to hold information about the type of the style option, and
3055 is defined for each QStyleOption subclass.
3056
3057 \value Type The type of style option provided (\l{SO_ViewItem} for this class).
3058
3059 The type is used internally by QStyleOption, its subclasses, and
3060 qstyleoption_cast() to determine the type of style option. In
3061 general you do not need to worry about this unless you want to
3062 create your own QStyleOption subclass and your own styles.
3063
3064 \sa StyleOptionVersion
3065*/
3066
3067/*!
3068 \enum QStyleOptionViewItem::StyleOptionVersion
3069
3070 This enum is used to hold information about the version of the style option, and
3071 is defined for each QStyleOption subclass.
3072
3073 \value Version 4
3074
3075 The version is used by QStyleOption subclasses to implement
3076 extensions without breaking compatibility. If you use
3077 qstyleoption_cast(), you normally do not need to check it.
3078
3079 \sa StyleOptionType
3080*/
3081
3082/*!
3083 \variable QStyleOptionViewItem::displayAlignment
3084 \brief the alignment of the display value for the item
3085
3086 The default value is Qt::AlignLeft.
3087*/
3088
3089/*!
3090 \variable QStyleOptionViewItem::decorationAlignment
3091 \brief the alignment of the decoration for the item
3092
3093 The default value is Qt::AlignLeft.
3094*/
3095
3096/*!
3097 \variable QStyleOptionViewItem::decorationPosition
3098 \brief the position of the decoration for the item
3099
3100 The default value is \l Left.
3101
3102 \sa Position
3103*/
3104
3105/*!
3106 \variable QStyleOptionViewItem::decorationSize
3107 \brief the size of the decoration for the item
3108
3109 The default value is QSize(-1, -1), i.e. an invalid size.
3110
3111 \sa decorationAlignment, decorationPosition
3112*/
3113
3114/*!
3115 \variable QStyleOptionViewItem::font
3116 \brief the font used for the item
3117
3118 By default, the application's default font is used.
3119
3120 \sa QFont
3121*/
3122
3123/*!
3124 \variable QStyleOptionViewItem::features
3125 \brief a bitwise OR of the features that describe this view item
3126
3127 \sa ViewItemFeature
3128*/
3129
3130/*!
3131 \enum QStyleOptionViewItem::ViewItemFeature
3132
3133 This enum describes the different types of features an item can have.
3134
3135 \value None Indicates a normal item.
3136 \value WrapText Indicates an item with wrapped text.
3137 \value Alternate Indicates that the item's background is rendered using alternateBase.
3138 \value HasCheckIndicator Indicates that the item has a check state indicator.
3139 \value HasDisplay Indicates that the item has a display role.
3140 \value HasDecoration Indicates that the item has a decoration role.
3141 \value [since 6.9] IsDecoratedRootColumn Indicates that the item has a tree view branch
3142 part for painting.
3143 \value [since 6.9] IsDecorationForRootColumn Indicates that the item contains the
3144 information to draw the tree view branch part.
3145*/
3146
3147/*!
3148 \variable QStyleOptionViewItem::index
3149
3150 The model index that is to be drawn.
3151*/
3152
3153/*!
3154 \variable QStyleOptionViewItem::checkState
3155
3156 If this view item is checkable, i.e.,
3157 ViewItemFeature::HasCheckIndicator is true, \c checkState is true
3158 if the item is checked; otherwise, it is false.
3159
3160*/
3161
3162/*!
3163 \variable QStyleOptionViewItem::icon
3164
3165 The icon (if any) to be drawn in the view item.
3166*/
3167
3168
3169/*!
3170 \variable QStyleOptionViewItem::text
3171
3172 The text (if any) to be drawn in the view item.
3173*/
3174
3175/*!
3176 \variable QStyleOptionViewItem::backgroundBrush
3177
3178 The QBrush that should be used to paint the view items
3179 background.
3180*/
3181
3182/*!
3183 \variable QStyleOptionViewItem::viewItemPosition
3184
3185 Gives the position of this view item relative to other items. See
3186 the \l{QStyleOptionViewItem::}{ViewItemPosition} enum for the
3187 details.
3188*/
3189
3190/*!
3191 \enum QStyleOptionViewItem::ViewItemPosition
3192
3193 This enum is used to represent the placement of the item on
3194 a row. This can be used to draw items differently depending
3195 on their placement, for example by putting rounded edges at
3196 the beginning and end, and straight edges in between.
3197
3198 \value Invalid The ViewItemPosition is unknown and should be
3199 disregarded.
3200 \value Beginning The item appears at the beginning of the row.
3201 \value Middle The item appears in the middle of the row.
3202 \value End The item appears at the end of the row.
3203 \value OnlyOne The item is the only one on the row, and is
3204 therefore both at the beginning and the end.
3205*/
3206
3207#endif // QT_CONFIG(itemviews)
3208/*!
3209 \fn template <typename T> T qstyleoption_cast<T>(const QStyleOption *option)
3210 \relates QStyleOption
3211
3212 Returns a T or \nullptr depending on the \l{QStyleOption::type}{type} and
3213 \l{QStyleOption::version}{version} of the given \a option.
3214
3215 Example:
3216
3217 \snippet qstyleoption/main.cpp 4
3218
3219 \sa QStyleOption::type, QStyleOption::version
3220*/
3221
3222/*!
3223 \fn template <typename T> T qstyleoption_cast<T>(QStyleOption *option)
3224 \overload
3225 \relates QStyleOption
3226
3227 Returns a T or \nullptr depending on the type of the given \a option.
3228*/
3229
3230#if QT_CONFIG(tabwidget)
3231/*!
3232 \class QStyleOptionTabWidgetFrame
3233 \brief The QStyleOptionTabWidgetFrame class is used to describe the
3234 parameters for drawing the frame around a tab widget.
3235
3236 \inmodule QtWidgets
3237
3238 QStyleOptionTabWidgetFrame contains all the information that
3239 QStyle functions need to draw the frame around QTabWidget.
3240
3241 For performance reasons, there are few member functions and the
3242 access to the member variables is direct (i.e., using the \c . or
3243 \c -> operator). This makes the structures straightforward to use
3244 and emphasizes that these are simply parameters used by the style
3245 functions.
3246
3247 \sa QStyleOption, QTabWidget
3248*/
3249
3250/*!
3251 Constructs a QStyleOptionTabWidgetFrame, initializing the members
3252 variables to their default values.
3253*/
3254QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame()
3255 : QStyleOptionTabWidgetFrame(Version)
3256{
3257}
3258
3259/*!
3260 \fn QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
3261
3262 Constructs a copy of \a other.
3263*/
3264
3265/*! \internal */
3266QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version)
3267 : QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
3268 shape(QTabBar::RoundedNorth)
3269{
3270}
3271
3272/*!
3273 \enum QStyleOptionTabWidgetFrame::StyleOptionType
3274
3275 This enum is used to hold information about the type of the style option, and
3276 is defined for each QStyleOption subclass.
3277
3278 \value Type The type of style option provided (\l{SO_TabWidgetFrame} for this class).
3279
3280 The type is used internally by QStyleOption, its subclasses, and
3281 qstyleoption_cast() to determine the type of style option. In
3282 general you do not need to worry about this unless you want to
3283 create your own QStyleOption subclass and your own styles.
3284
3285 \sa StyleOptionVersion
3286*/
3287
3288/*!
3289 \enum QStyleOptionTabWidgetFrame::StyleOptionVersion
3290
3291 This enum is used to hold information about the version of the style option, and
3292 is defined for each QStyleOption subclass.
3293
3294 \value Version 2
3295
3296 The version is used by QStyleOption subclasses to implement
3297 extensions without breaking compatibility. If you use
3298 qstyleoption_cast(), you normally do not need to check it.
3299
3300 \sa StyleOptionType
3301*/
3302
3303/*!
3304 \variable QStyleOptionTabWidgetFrame::lineWidth
3305 \brief the line width for drawing the panel
3306
3307 The default value is 0.
3308*/
3309
3310/*!
3311 \variable QStyleOptionTabWidgetFrame::midLineWidth
3312 \brief the mid-line width for drawing the panel
3313
3314 The mid line width is usually used in drawing sunken or raised
3315 frames. The default value is 0.
3316*/
3317
3318/*!
3319 \variable QStyleOptionTabWidgetFrame::shape
3320 \brief the tab shape used to draw the tabs
3321
3322 The default value is QTabBar::RoundedNorth.
3323*/
3324
3325/*!
3326 \variable QStyleOptionTabWidgetFrame::tabBarSize
3327 \brief the size of the tab bar
3328
3329 The default value is QSize(-1, -1), i.e. an invalid size.
3330*/
3331
3332/*!
3333 \variable QStyleOptionTabWidgetFrame::rightCornerWidgetSize
3334 \brief the size of the right-corner widget
3335
3336 The default value is QSize(-1, -1), i.e. an invalid size.
3337*/
3338
3339/*! \variable QStyleOptionTabWidgetFrame::leftCornerWidgetSize
3340 \brief the size of the left-corner widget
3341
3342 The default value is QSize(-1, -1), i.e. an invalid size.
3343*/
3344
3345
3346/*!
3347 \variable QStyleOptionTabWidgetFrame::tabBarRect
3348 \brief the rectangle containing all the tabs
3349
3350 The default value is a null rectangle, i.e. a rectangle with both
3351 the width and the height set to 0.
3352*/
3353
3354/*!
3355 \variable QStyleOptionTabWidgetFrame::selectedTabRect
3356 \brief the rectangle containing the selected tab
3357
3358 This rectangle is contained within the tabBarRect. The default
3359 value is a null rectangle, i.e. a rectangle with both the width
3360 and the height set to 0.
3361*/
3362
3363#endif // QT_CONFIG(tabwidget)
3364
3365#if QT_CONFIG(tabbar)
3366
3367/*!
3368 \class QStyleOptionTabBarBase
3369 \brief The QStyleOptionTabBarBase class is used to describe
3370 the base of a tab bar, i.e. the part that the tab bar usually
3371 overlaps with.
3372
3373 \inmodule QtWidgets
3374
3375 QStyleOptionTabBarBase contains all the information that QStyle
3376 functions need to draw the tab bar base. Note that this is only
3377 drawn for a standalone QTabBar (one that isn't part of a
3378 QTabWidget).
3379
3380 For performance reasons, there are few member functions and the
3381 access to the member variables is direct (i.e., using the \c . or
3382 \c -> operator). This makes the structures straightforward to use
3383 and emphasizes that these are simply parameters used by the style
3384 functions.
3385
3386 \sa QStyleOption, QTabBar::drawBase()
3387*/
3388
3389/*!
3390 Construct a QStyleOptionTabBarBase, initializing the members
3391 variables to their default values.
3392*/
3393QStyleOptionTabBarBase::QStyleOptionTabBarBase()
3394 : QStyleOptionTabBarBase(Version)
3395{
3396}
3397
3398/*! \internal */
3399QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
3400 : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth),
3401 documentMode(false)
3402{
3403}
3404
3405/*!
3406 \fn QStyleOptionTabBarBase::QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other)
3407
3408 Constructs a copy of \a other.
3409*/
3410
3411/*!
3412 \enum QStyleOptionTabBarBase::StyleOptionType
3413
3414 This enum is used to hold information about the type of the style option, and
3415 is defined for each QStyleOption subclass.
3416
3417 \value Type The type of style option provided (\l{SO_TabBarBase} for this class).
3418
3419 The type is used internally by QStyleOption, its subclasses, and
3420 qstyleoption_cast() to determine the type of style option. In
3421 general you do not need to worry about this unless you want to
3422 create your own QStyleOption subclass and your own styles.
3423
3424 \sa StyleOptionVersion
3425*/
3426
3427/*!
3428 \enum QStyleOptionTabBarBase::StyleOptionVersion
3429
3430 This enum is used to hold information about the version of the style option, and
3431 is defined for each QStyleOption subclass.
3432
3433 \value Version 2
3434
3435 The version is used by QStyleOption subclasses to implement
3436 extensions without breaking compatibility. If you use
3437 qstyleoption_cast(), you normally do not need to check it.
3438
3439 \sa StyleOptionType
3440*/
3441
3442/*!
3443 \variable QStyleOptionTabBarBase::shape
3444 \brief the shape of the tab bar
3445
3446 The default value is QTabBar::RoundedNorth.
3447*/
3448
3449/*!
3450 \variable QStyleOptionTabBarBase::tabBarRect
3451 \brief the rectangle containing all the tabs
3452
3453 The default value is a null rectangle, i.e. a rectangle with both
3454 the width and the height set to 0.
3455*/
3456
3457/*!
3458 \variable QStyleOptionTabBarBase::selectedTabRect
3459 \brief the rectangle containing the selected tab
3460
3461 This rectangle is contained within the tabBarRect. The default
3462 value is a null rectangle, i.e. a rectangle with both the width
3463 and the height set to 0.
3464*/
3465
3466
3467/*!
3468 \variable QStyleOptionTabBarBase::documentMode
3469 \brief whether the tabbar is in document mode.
3470
3471 The default value is false;
3472*/
3473
3474#endif // QT_CONFIG(tabbar)
3475
3476#if QT_CONFIG(sizegrip)
3477/*!
3478 \class QStyleOptionSizeGrip
3479 \brief The QStyleOptionSizeGrip class is used to describe the
3480 parameter for drawing a size grip.
3481 \since 4.2
3482 \inmodule QtWidgets
3483
3484 QStyleOptionButton contains all the information that QStyle
3485 functions need to draw QSizeGrip.
3486
3487 For performance reasons, there are few member functions and the
3488 access to the member variables is direct (i.e., using the \c . or
3489 \c -> operator). This makes the structures straightforward to use
3490 and emphasizes that these are simply parameters used by the style
3491 functions.
3492
3493 \sa QStyleOption, QStyleOptionComplex, QSizeGrip
3494*/
3495
3496/*!
3497 Constructs a QStyleOptionSizeGrip.
3498*/
3499QStyleOptionSizeGrip::QStyleOptionSizeGrip()
3500 : QStyleOptionSizeGrip(Version)
3501{
3502}
3503
3504/*!
3505 \fn QStyleOptionSizeGrip::QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other)
3506
3507 Constructs a copy of the \a other style option.
3508*/
3509
3510/*!
3511 \internal
3512*/
3513QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
3514 : QStyleOptionComplex(version, Type), corner(Qt::BottomRightCorner)
3515{
3516}
3517
3518/*!
3519 \variable QStyleOptionSizeGrip::corner
3520
3521 The corner in which the size grip is located.
3522*/
3523
3524/*!
3525 \enum QStyleOptionSizeGrip::StyleOptionType
3526
3527 This enum is used to hold information about the type of the style option, and
3528 is defined for each QStyleOption subclass.
3529
3530 \value Type The type of style option provided (\l{SO_TabBarBase} for this class).
3531
3532 The type is used internally by QStyleOption, its subclasses, and
3533 qstyleoption_cast() to determine the type of style option. In
3534 general you do not need to worry about this unless you want to
3535 create your own QStyleOption subclass and your own styles.
3536
3537 \sa StyleOptionVersion
3538*/
3539
3540/*!
3541 \enum QStyleOptionSizeGrip::StyleOptionVersion
3542
3543 This enum is used to hold information about the version of the style option, and
3544 is defined for each QStyleOption subclass.
3545
3546 \value Version 1
3547
3548 The version is used by QStyleOption subclasses to implement
3549 extensions without breaking compatibility. If you use
3550 qstyleoption_cast(), you normally do not need to check it.
3551
3552 \sa StyleOptionType
3553*/
3554#endif // QT_CONFIG(sizegrip)
3555
3556/*!
3557 \class QStyleOptionGraphicsItem
3558 \brief The QStyleOptionGraphicsItem class is used to describe
3559 the parameters needed to draw a QGraphicsItem.
3560 \since 4.2
3561 \ingroup graphicsview-api
3562 \inmodule QtWidgets
3563
3564 For performance reasons, there are few member functions and the
3565 access to the member variables is direct (i.e., using the \c . or
3566 \c -> operator). This makes the structures straightforward to use
3567 and emphasizes that these are simply parameters used by the style
3568 functions.
3569
3570 \sa QStyleOption, QGraphicsItem::paint()
3571*/
3572
3573/*!
3574 \enum QStyleOptionGraphicsItem::StyleOptionType
3575
3576 This enum is used to hold information about the type of the style option, and
3577 is defined for each QStyleOption subclass.
3578
3579 \value Type The type of style option provided (\l SO_GraphicsItem for this class).
3580
3581 The type is used internally by QStyleOption, its subclasses, and
3582 qstyleoption_cast() to determine the type of style option. In
3583 general you do not need to worry about this unless you want to
3584 create your own QStyleOption subclass and your own styles.
3585
3586 \sa StyleOptionVersion
3587*/
3588
3589/*!
3590 \enum QStyleOptionGraphicsItem::StyleOptionVersion
3591
3592 This enum is used to hold information about the version of the style option, and
3593 is defined for each QStyleOption subclass.
3594
3595 \value Version 1
3596
3597 The version is used by QStyleOption subclasses to implement
3598 extensions without breaking compatibility. If you use
3599 qstyleoption_cast(), you normally do not need to check it.
3600
3601 \sa StyleOptionType
3602*/
3603
3604/*!
3605 Constructs a QStyleOptionGraphicsItem.
3606*/
3607QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
3608 : QStyleOptionGraphicsItem(Version)
3609{
3610}
3611
3612/*!
3613 \internal
3614*/
3615QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version)
3616 : QStyleOption(version, Type)
3617{
3618}
3619
3620/*!
3621 \since 4.6
3622
3623 Returns the level of detail from the \a worldTransform.
3624
3625 Its value represents the maximum value of the height and
3626 width of a unity rectangle, mapped using the \a worldTransform
3627 of the painter used to draw the item. By default, if no
3628 transformations are applied, its value is 1. If zoomed out 1:2, the level
3629 of detail will be 0.5, and if zoomed in 2:1, its value is 2.
3630
3631 \sa QGraphicsScene::minimumRenderSize()
3632*/
3633qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform)
3634{
3635 if (worldTransform.type() <= QTransform::TxTranslate)
3636 return 1; // Translation only? The LOD is 1.
3637
3638 // Two unit vectors.
3639 QLineF v1(0, 0, 1, 0);
3640 QLineF v2(0, 0, 0, 1);
3641 // LOD is the transformed area of a 1x1 rectangle.
3642 return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
3643}
3644
3645/*!
3646 \fn QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other)
3647
3648 Constructs a copy of \a other.
3649*/
3650
3651/*!
3652 \variable QStyleOptionGraphicsItem::exposedRect
3653 \brief the exposed rectangle, in item coordinates
3654
3655 Make use of this rectangle to speed up item drawing when only parts of the
3656 item are exposed. If the whole item is exposed, this rectangle will be the
3657 same as QGraphicsItem::boundingRect().
3658
3659 This member is only initialized for items that have the
3660 QGraphicsItem::ItemUsesExtendedStyleOption flag set.
3661*/
3662
3663/*!
3664 \class QStyleHintReturn
3665 \brief The QStyleHintReturn class provides style hints that return more
3666 than basic data types.
3667
3668 \ingroup appearance
3669 \inmodule QtWidgets
3670
3671 QStyleHintReturn and its subclasses are used to pass information
3672 from a style back to the querying widget. This is most useful
3673 when the return value from QStyle::styleHint() does not provide enough
3674 detail; for example, when a mask is to be returned.
3675*/
3676
3677/*!
3678 \enum QStyleHintReturn::HintReturnType
3679
3680 \value SH_Default QStyleHintReturn
3681 \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
3682 \value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat
3683*/
3684
3685/*!
3686 \enum QStyleHintReturn::StyleOptionType
3687
3688 This enum is used to hold information about the type of the style option, and
3689 is defined for each QStyleHintReturn subclass.
3690
3691 \value Type The type of style option provided (\l SH_Default for
3692 this class).
3693
3694 The type is used internally by QStyleHintReturn, its subclasses, and
3695 qstyleoption_cast() to determine the type of style option. In
3696 general you do not need to worry about this unless you want to
3697 create your own QStyleHintReturn subclass and your own styles.
3698
3699 \sa StyleOptionVersion
3700*/
3701
3702/*!
3703 \enum QStyleHintReturn::StyleOptionVersion
3704
3705 This enum is used to hold information about the version of the style option, and
3706 is defined for each QStyleHintReturn subclass.
3707
3708 \value Version 1
3709
3710 The version is used by QStyleHintReturn subclasses to implement
3711 extensions without breaking compatibility. If you use
3712 qstyleoption_cast(), you normally do not need to check it.
3713
3714 \sa StyleOptionType
3715*/
3716
3717/*!
3718 \variable QStyleHintReturn::type
3719 \brief the type of the style hint container
3720
3721 \sa HintReturnType
3722*/
3723
3724/*!
3725 \variable QStyleHintReturn::version
3726 \brief the version of the style hint return container
3727
3728 This value can be used by subclasses to implement extensions
3729 without breaking compatibility. If you use qstyleoption_cast<T>(), you
3730 normally do not need to check it.
3731*/
3732
3733/*!
3734 Constructs a QStyleHintReturn with version \a version and type \a
3735 type.
3736
3737 The version has no special meaning for QStyleHintReturn; it can be
3738 used by subclasses to distinguish between different version of
3739 the same hint type.
3740
3741 \sa QStyleOption::version, QStyleOption::type
3742*/
3743
3744QStyleHintReturn::QStyleHintReturn(int version, int type)
3745 : version(version), type(type)
3746{
3747}
3748
3749/*!
3750 \internal
3751*/
3752
3753QStyleHintReturn::~QStyleHintReturn()
3754{
3755
3756}
3757
3758/*!
3759 \class QStyleHintReturnMask
3760 \brief The QStyleHintReturnMask class provides style hints that return a QRegion.
3761
3762 \ingroup appearance
3763 \inmodule QtWidgets
3764*/
3765
3766/*!
3767 \variable QStyleHintReturnMask::region
3768 \brief the region for style hints that return a QRegion
3769*/
3770
3771/*!
3772 Constructs a QStyleHintReturnMask. The member variables are
3773 initialized to default values.
3774*/
3775QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type)
3776{
3777}
3778
3779/*!
3780 Destructor.
3781*/
3782QStyleHintReturnMask::~QStyleHintReturnMask()
3783{
3784}
3785
3786/*!
3787 \enum QStyleHintReturnMask::StyleOptionType
3788
3789 This enum is used to hold information about the type of the style option, and
3790 is defined for each QStyleHintReturn subclass.
3791
3792 \value Type The type of style option provided (\l{SH_Mask} for
3793 this class).
3794
3795 The type is used internally by QStyleHintReturn, its subclasses, and
3796 qstyleoption_cast() to determine the type of style option. In
3797 general you do not need to worry about this unless you want to
3798 create your own QStyleHintReturn subclass and your own styles.
3799
3800 \sa StyleOptionVersion
3801*/
3802
3803/*!
3804 \enum QStyleHintReturnMask::StyleOptionVersion
3805
3806 This enum is used to hold information about the version of the style option, and
3807 is defined for each QStyleHintReturn subclass.
3808
3809 \value Version 1
3810
3811 The version is used by QStyleHintReturn subclasses to implement
3812 extensions without breaking compatibility. If you use
3813 qstyleoption_cast(), you normally do not need to check it.
3814
3815 \sa StyleOptionType
3816*/
3817
3818/*!
3819 \class QStyleHintReturnVariant
3820 \brief The QStyleHintReturnVariant class provides style hints that return a QVariant.
3821 \since 4.3
3822 \ingroup appearance
3823 \inmodule QtWidgets
3824*/
3825
3826/*!
3827 \variable QStyleHintReturnVariant::variant
3828 \brief the variant for style hints that return a QVariant
3829*/
3830
3831/*!
3832 Constructs a QStyleHintReturnVariant. The member variables are
3833 initialized to default values.
3834*/
3835QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, Type)
3836{
3837}
3838
3839/*!
3840 Destructor.
3841*/
3842QStyleHintReturnVariant::~QStyleHintReturnVariant()
3843{
3844}
3845
3846/*!
3847 \enum QStyleHintReturnVariant::StyleOptionType
3848
3849 This enum is used to hold information about the type of the style option, and
3850 is defined for each QStyleHintReturn subclass.
3851
3852 \value Type The type of style option provided (\l{SH_Variant} for
3853 this class).
3854
3855 The type is used internally by QStyleHintReturn, its subclasses, and
3856 qstyleoption_cast() to determine the type of style option. In
3857 general you do not need to worry about this unless you want to
3858 create your own QStyleHintReturn subclass and your own styles.
3859
3860 \sa StyleOptionVersion
3861*/
3862
3863/*!
3864 \enum QStyleHintReturnVariant::StyleOptionVersion
3865
3866 This enum is used to hold information about the version of the style option, and
3867 is defined for each QStyleHintReturn subclass.
3868
3869 \value Version 1
3870
3871 The version is used by QStyleHintReturn subclasses to implement
3872 extensions without breaking compatibility. If you use
3873 qstyleoption_cast(), you normally do not need to check it.
3874
3875 \sa StyleOptionType
3876*/
3877
3878/*!
3879 \fn template <typename T> T qstyleoption_cast<T>(const QStyleHintReturn *hint)
3880 \relates QStyleHintReturn
3881
3882 Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type}
3883 and \l{QStyleHintReturn::version}{version} of \a hint.
3884
3885 Example:
3886
3887 \snippet code/src_gui_styles_qstyleoption.cpp 0
3888
3889 \sa QStyleHintReturn::type, QStyleHintReturn::version
3890*/
3891
3892/*!
3893 \fn template <typename T> T qstyleoption_cast<T>(QStyleHintReturn *hint)
3894 \overload
3895 \relates QStyleHintReturn
3896
3897 Returns a T or \nullptr depending on the type of \a hint.
3898*/
3899
3900#if !defined(QT_NO_DEBUG_STREAM)
3901QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
3902{
3903#if !defined(QT_NO_DEBUG)
3904 switch (optionType) {
3905 case QStyleOption::SO_Default:
3906 debug << "SO_Default"; break;
3907 case QStyleOption::SO_FocusRect:
3908 debug << "SO_FocusRect"; break;
3909 case QStyleOption::SO_Button:
3910 debug << "SO_Button"; break;
3911 case QStyleOption::SO_Tab:
3912 debug << "SO_Tab"; break;
3913 case QStyleOption::SO_MenuItem:
3914 debug << "SO_MenuItem"; break;
3915 case QStyleOption::SO_Frame:
3916 debug << "SO_Frame"; break;
3917 case QStyleOption::SO_ProgressBar:
3918 debug << "SO_ProgressBar"; break;
3919 case QStyleOption::SO_ToolBox:
3920 debug << "SO_ToolBox"; break;
3921 case QStyleOption::SO_Header:
3922 debug << "SO_Header"; break;
3923 case QStyleOption::SO_DockWidget:
3924 debug << "SO_DockWidget"; break;
3925 case QStyleOption::SO_ViewItem:
3926 debug << "SO_ViewItem"; break;
3927 case QStyleOption::SO_TabWidgetFrame:
3928 debug << "SO_TabWidgetFrame"; break;
3929 case QStyleOption::SO_TabBarBase:
3930 debug << "SO_TabBarBase"; break;
3931 case QStyleOption::SO_RubberBand:
3932 debug << "SO_RubberBand"; break;
3933 case QStyleOption::SO_Complex:
3934 debug << "SO_Complex"; break;
3935 case QStyleOption::SO_Slider:
3936 debug << "SO_Slider"; break;
3937 case QStyleOption::SO_SpinBox:
3938 debug << "SO_SpinBox"; break;
3939 case QStyleOption::SO_ToolButton:
3940 debug << "SO_ToolButton"; break;
3941 case QStyleOption::SO_ComboBox:
3942 debug << "SO_ComboBox"; break;
3943 case QStyleOption::SO_TitleBar:
3944 debug << "SO_TitleBar"; break;
3945 case QStyleOption::SO_CustomBase:
3946 debug << "SO_CustomBase"; break;
3947 case QStyleOption::SO_GroupBox:
3948 debug << "SO_GroupBox"; break;
3949 case QStyleOption::SO_ToolBar:
3950 debug << "SO_ToolBar"; break;
3951 case QStyleOption::SO_ComplexCustomBase:
3952 debug << "SO_ComplexCustomBase"; break;
3953 case QStyleOption::SO_SizeGrip:
3954 debug << "SO_SizeGrip"; break;
3955 case QStyleOption::SO_GraphicsItem:
3956 debug << "SO_GraphicsItem"; break;
3957 }
3958#else
3959 Q_UNUSED(optionType);
3960#endif
3961 return debug;
3962}
3963
3964QDebug operator<<(QDebug debug, const QStyleOption &option)
3965{
3966#if !defined(QT_NO_DEBUG)
3967 debug << "QStyleOption(";
3968 debug << QStyleOption::OptionType(option.type);
3969 debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
3970 debug << ',' << option.state;
3971 debug << ',' << option.rect;
3972 debug << ',' << option.styleObject;
3973 debug << ')';
3974#else
3975 Q_UNUSED(option);
3976#endif
3977 return debug;
3978}
3979#endif
3980
3981QT_END_NAMESPACE
\variable QStyleOptionProgressBar::minimum
Combined button and popup list for selecting options.