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 \brief The QStyleOptionMenuItemV2 class enhances
1603 QStyleOptionMenuItem with new members.
1604
1605 \inmodule QtWidgets
1606*/
1607
1608/*!
1609 Constructs a QStyleOptionMenuItemV2, initializing the members
1610 variables to their default values.
1611*/
1612QStyleOptionMenuItemV2::QStyleOptionMenuItemV2()
1613 : QStyleOptionMenuItemV2(QStyleOptionMenuItemV2::Version)
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), mouseDown(false)
1627{}
1628
1629/*!
1630 \variable QStyleOptionMenuItemV2::mouseDown
1631 \brief true when the mouse is pressed down.
1632
1633 This is needed because there is no differentation between
1634 a pressed and a sunken state when QStyle::State_Sunken is set.
1635 QStyle::State_Sunken is also set when the menu is open
1636 (i.e. showing the popup menu)
1637*/
1638
1639/*!
1640 \class QStyleOptionMenuItem
1641 \brief The QStyleOptionMenuItem class is used to describe the
1642 parameter necessary for drawing a menu item.
1643
1644 \inmodule QtWidgets
1645
1646 QStyleOptionMenuItem contains all the information that QStyle
1647 functions need to draw the menu items from \l QMenu. It is also
1648 used for drawing other menu-related widgets.
1649
1650 For performance reasons, there are few member functions and the
1651 access to the member variables is direct (i.e., using the \c . or
1652 \c -> operator). This makes the structures straightforward to use
1653 and emphasizes that these are simply parameters used by the style
1654 functions.
1655
1656 \sa QStyleOption
1657*/
1658
1659/*!
1660 Constructs a QStyleOptionMenuItem, initializing the members
1661 variables to their default values.
1662*/
1663
1664QStyleOptionMenuItem::QStyleOptionMenuItem()
1665 : QStyleOptionMenuItem(QStyleOptionMenuItem::Version)
1666{
1667}
1668
1669/*!
1670 \internal
1671*/
1672QStyleOptionMenuItem::QStyleOptionMenuItem(int version)
1673 : QStyleOption(version, SO_MenuItem), menuItemType(Normal),
1674 checkType(NotCheckable), checked(false), menuHasCheckableItems(true), maxIconWidth(0),
1675 reservedShortcutWidth(0)
1676{
1677}
1678
1679/*!
1680 \fn QStyleOptionMenuItem::QStyleOptionMenuItem(const QStyleOptionMenuItem &other)
1681
1682 Constructs a copy of the \a other style option.
1683*/
1684
1685/*!
1686 \enum QStyleOptionMenuItem::StyleOptionType
1687
1688 This enum is used to hold information about the type of the style option, and
1689 is defined for each QStyleOption subclass.
1690
1691 \value Type The type of style option provided (\l{SO_MenuItem} for this class).
1692
1693 The type is used internally by QStyleOption, its subclasses, and
1694 qstyleoption_cast() to determine the type of style option. In
1695 general you do not need to worry about this unless you want to
1696 create your own QStyleOption subclass and your own styles.
1697
1698 \sa StyleOptionVersion
1699*/
1700
1701/*!
1702 \enum QStyleOptionMenuItem::StyleOptionVersion
1703
1704 This enum is used to hold information about the version of the style option, and
1705 is defined for each QStyleOption subclass.
1706
1707 \value Version 1
1708
1709 The version is used by QStyleOption subclasses to implement
1710 extensions without breaking compatibility. If you use
1711 qstyleoption_cast(), you normally do not need to check it.
1712
1713 \sa StyleOptionType
1714*/
1715
1716/*!
1717 \enum QStyleOptionMenuItem::MenuItemType
1718
1719 This enum indicates the type of menu item that the structure describes.
1720
1721 \value Normal A normal menu item.
1722 \value DefaultItem A menu item that is the default action as specified with \l QMenu::defaultAction().
1723 \value Separator A menu separator.
1724 \value SubMenu Indicates the menu item points to a sub-menu.
1725 \value Scroller A popup menu scroller (currently only used on \macos).
1726 \value TearOff A tear-off handle for the menu.
1727 \value Margin The margin of the menu.
1728 \value EmptyArea The empty area of the menu.
1729
1730 \sa menuItemType
1731*/
1732
1733/*!
1734 \enum QStyleOptionMenuItem::CheckType
1735
1736 This enum is used to indicate whether or not a check mark should be
1737 drawn for the item, or even if it should be drawn at all.
1738
1739 \value NotCheckable The item is not checkable.
1740 \value Exclusive The item is an exclusive check item (like a radio button).
1741 \value NonExclusive The item is a non-exclusive check item (like a check box).
1742
1743 \sa checkType, QAction::checkable, QAction::checked, QActionGroup::exclusionPolicy
1744*/
1745
1746/*!
1747 \variable QStyleOptionMenuItem::menuItemType
1748 \brief the type of menu item
1749
1750 The default value is \l Normal.
1751
1752 \sa MenuItemType
1753*/
1754
1755/*!
1756 \variable QStyleOptionMenuItem::checkType
1757 \brief the type of checkmark of the menu item
1758
1759 The default value is \l NotCheckable.
1760
1761 \sa CheckType
1762*/
1763
1764/*!
1765 \variable QStyleOptionMenuItem::checked
1766 \brief whether the menu item is checked or not
1767
1768 The default value is false.
1769*/
1770
1771/*!
1772 \variable QStyleOptionMenuItem::menuHasCheckableItems
1773 \brief whether the menu as a whole has checkable items or not
1774
1775 The default value is true.
1776
1777 If this option is set to false, then the menu has no checkable
1778 items. This makes it possible for GUI styles to save some
1779 horizontal space that would normally be used for the check column.
1780*/
1781
1782/*!
1783 \variable QStyleOptionMenuItem::menuRect
1784 \brief the rectangle for the entire menu
1785
1786 The default value is a null rectangle, i.e. a rectangle with both
1787 the width and the height set to 0.
1788*/
1789
1790/*!
1791 \variable QStyleOptionMenuItem::text
1792 \brief the text for the menu item
1793
1794 Note that the text format is something like this "Menu
1795 text\b{\\t}Shortcut".
1796
1797 If the menu item doesn't have a shortcut, it will just contain the
1798 menu item's text. The default value is an empty string.
1799*/
1800
1801/*!
1802 \variable QStyleOptionMenuItem::icon
1803 \brief the icon for the menu item
1804
1805 The default value is an empty icon, i.e. an icon with neither a
1806 pixmap nor a filename.
1807*/
1808
1809/*!
1810 \variable QStyleOptionMenuItem::maxIconWidth
1811 \brief the maximum icon width for the icon in the menu item
1812
1813 This can be used for drawing the icon into the correct place or
1814 properly aligning items. The variable must be set regardless of
1815 whether or not the menu item has an icon. The default value is 0.
1816*/
1817
1818/*!
1819 \variable QStyleOptionMenuItem::reservedShortcutWidth
1820 \brief the reserved width for the menu item's shortcut
1821
1822 QMenu sets it to the width occupied by the widest shortcut among
1823 all visible items within the menu.
1824
1825 The default value is 0.
1826*/
1827
1828
1829/*!
1830 \variable QStyleOptionMenuItem::font
1831 \brief the font used for the menu item text
1832
1833 This is the font that should be used for drawing the menu text
1834 minus the shortcut. The shortcut is usually drawn using the
1835 painter's font. By default, the application's default font is
1836 used.
1837*/
1838
1839/*!
1840 \class QStyleOptionComplex
1841 \brief The QStyleOptionComplex class is used to hold parameters that are
1842 common to all complex controls.
1843
1844 \inmodule QtWidgets
1845
1846 This class is not used on its own. Instead it is used to derive
1847 other complex control options, for example QStyleOptionSlider and
1848 QStyleOptionSpinBox.
1849
1850 For performance reasons, there are few member functions and the
1851 access to the member variables is direct (i.e., using the \c . or
1852 \c -> operator). This makes the structures straightforward to use
1853 and emphasizes that these are simply parameters used by the style
1854 functions.
1855
1856 \sa QStyleOption
1857*/
1858
1859/*!
1860 Constructs a QStyleOptionComplex of the specified \a type and \a
1861 version, initializing the member variables to their default
1862 values. This constructor is usually called by subclasses.
1863*/
1864
1865QStyleOptionComplex::QStyleOptionComplex(int version, int type)
1866 : QStyleOption(version, type), subControls(QStyle::SC_All), activeSubControls(QStyle::SC_None)
1867{
1868}
1869
1870/*!
1871 \fn QStyleOptionComplex::QStyleOptionComplex(const QStyleOptionComplex &other)
1872
1873 Constructs a copy of the \a other style option.
1874*/
1875
1876/*!
1877 \enum QStyleOptionComplex::StyleOptionType
1878
1879 This enum is used to hold information about the type of the style option, and
1880 is defined for each QStyleOption subclass.
1881
1882 \value Type The type of style option provided (\l{SO_Complex} for this class).
1883
1884 The type is used internally by QStyleOption, its subclasses, and
1885 qstyleoption_cast() to determine the type of style option. In
1886 general you do not need to worry about this unless you want to
1887 create your own QStyleOption subclass and your own styles.
1888
1889 \sa StyleOptionVersion
1890*/
1891
1892/*!
1893 \enum QStyleOptionComplex::StyleOptionVersion
1894
1895 This enum is used to hold information about the version of the style option, and
1896 is defined for each QStyleOption subclass.
1897
1898 \value Version 1
1899
1900 The version is used by QStyleOption subclasses to implement
1901 extensions without breaking compatibility. If you use
1902 qstyleoption_cast(), you normally do not need to check it.
1903
1904 \sa StyleOptionType
1905*/
1906
1907/*!
1908 \variable QStyleOptionComplex::subControls
1909
1910 This variable holds a bitwise OR of the \l{QStyle::SubControl}
1911 {sub-controls} to be drawn for the complex control.
1912
1913 The default value is QStyle::SC_All.
1914
1915 \sa QStyle::SubControl
1916*/
1917
1918/*!
1919 \variable QStyleOptionComplex::activeSubControls
1920
1921 This variable holds a bitwise OR of the \l{QStyle::SubControl}
1922 {sub-controls} that are active for the complex control.
1923
1924 The default value is QStyle::SC_None.
1925
1926 \sa QStyle::SubControl
1927*/
1928
1929#if QT_CONFIG(slider)
1930/*!
1931 \class QStyleOptionSlider
1932 \brief The QStyleOptionSlider class is used to describe the
1933 parameters needed for drawing a slider.
1934
1935 \inmodule QtWidgets
1936
1937 QStyleOptionSlider contains all the information that QStyle
1938 functions need to draw QSlider and QScrollBar.
1939
1940 For performance reasons, there are few member functions and the
1941 access to the member variables is direct (i.e., using the \c . or
1942 \c -> operator). This makes the structures straightforward to use
1943 and emphasizes that these are simply parameters used by the style
1944 functions.
1945
1946 \sa QStyleOptionComplex, QSlider, QScrollBar
1947*/
1948
1949/*!
1950 Constructs a QStyleOptionSlider, initializing the members
1951 variables to their default values.
1952*/
1953
1954QStyleOptionSlider::QStyleOptionSlider()
1955 : QStyleOptionSlider(Version)
1956{
1957}
1958
1959/*!
1960 \internal
1961*/
1962QStyleOptionSlider::QStyleOptionSlider(int version)
1963 : QStyleOptionComplex(version, SO_Slider), orientation(Qt::Horizontal), minimum(0), maximum(0),
1964 tickPosition(QSlider::NoTicks), tickInterval(0), upsideDown(false),
1965 sliderPosition(0), sliderValue(0), singleStep(0), pageStep(0), notchTarget(0.0),
1966 dialWrapping(false), keyboardModifiers{}
1967{
1968}
1969
1970/*!
1971 \fn QStyleOptionSlider::QStyleOptionSlider(const QStyleOptionSlider &other)
1972
1973 Constructs a copy of the \a other style option.
1974*/
1975
1976/*!
1977 \enum QStyleOptionSlider::StyleOptionType
1978
1979 This enum is used to hold information about the type of the style option, and
1980 is defined for each QStyleOption subclass.
1981
1982 \value Type The type of style option provided (\l{SO_Slider} for this class).
1983
1984 The type is used internally by QStyleOption, its subclasses, and
1985 qstyleoption_cast() to determine the type of style option. In
1986 general you do not need to worry about this unless you want to
1987 create your own QStyleOption subclass and your own styles.
1988
1989 \sa StyleOptionVersion
1990*/
1991
1992/*!
1993 \enum QStyleOptionSlider::StyleOptionVersion
1994
1995 This enum is used to hold information about the version of the style option, and
1996 is defined for each QStyleOption subclass.
1997
1998 \value Version 1
1999
2000 The version is used by QStyleOption subclasses to implement
2001 extensions without breaking compatibility. If you use
2002 qstyleoption_cast(), you normally do not need to check it.
2003
2004 \sa StyleOptionType
2005*/
2006
2007/*!
2008 \variable QStyleOptionSlider::orientation
2009 \brief the slider's orientation (horizontal or vertical)
2010
2011 The default orientation is Qt::Horizontal.
2012
2013 \sa Qt::Orientation
2014*/
2015
2016/*!
2017 \variable QStyleOptionSlider::minimum
2018 \brief the minimum value for the slider
2019
2020 The default value is 0.
2021*/
2022
2023/*!
2024 \variable QStyleOptionSlider::maximum
2025 \brief the maximum value for the slider
2026
2027 The default value is 0.
2028*/
2029
2030/*!
2031 \variable QStyleOptionSlider::tickPosition
2032 \brief the position of the slider's tick marks, if any
2033
2034 The default value is QSlider::NoTicks.
2035
2036 \sa QSlider::TickPosition
2037*/
2038
2039/*!
2040 \variable QStyleOptionSlider::tickInterval
2041 \brief the interval that should be drawn between tick marks
2042
2043 The default value is 0.
2044*/
2045
2046/*!
2047 \variable QStyleOptionSlider::notchTarget
2048 \brief the number of pixel between notches
2049
2050 The default value is 0.0.
2051
2052 \sa QDial::notchTarget()
2053*/
2054
2055/*!
2056 \variable QStyleOptionSlider::dialWrapping
2057 \brief whether the dial should wrap or not
2058
2059 The default value is false, i.e. the dial is not wrapped.
2060
2061 \sa QDial::wrapping()
2062*/
2063
2064/*!
2065 \variable QStyleOptionSlider::upsideDown
2066 \brief the slider control orientation
2067
2068 Normally a slider increases as it moves up or to the right;
2069 upsideDown indicates that it should do the opposite (increase as
2070 it moves down or to the left). The default value is false,
2071 i.e. the slider increases as it moves up or to the right.
2072
2073 \sa QStyle::sliderPositionFromValue(),
2074 QStyle::sliderValueFromPosition(),
2075 QAbstractSlider::invertedAppearance
2076*/
2077
2078/*!
2079 \variable QStyleOptionSlider::sliderPosition
2080 \brief the position of the slider handle
2081
2082 If the slider has active feedback (i.e.,
2083 QAbstractSlider::tracking is true), this value will be the same as
2084 \l sliderValue. Otherwise, it will have the current position of
2085 the handle. The default value is 0.
2086
2087 \sa QAbstractSlider::tracking, sliderValue
2088*/
2089
2090/*!
2091 \variable QStyleOptionSlider::sliderValue
2092 \brief the value of the slider
2093
2094 If the slider has active feedback (i.e.,
2095 QAbstractSlider::tracking is true), this value will be the same
2096 as \l sliderPosition. Otherwise, it will have the value the
2097 slider had before the mouse was pressed.
2098
2099 The default value is 0.
2100
2101 \sa QAbstractSlider::tracking, sliderPosition
2102*/
2103
2104/*!
2105 \variable QStyleOptionSlider::singleStep
2106 \brief the size of the single step of the slider
2107
2108 The default value is 0.
2109
2110 \sa QAbstractSlider::singleStep
2111*/
2112
2113/*!
2114 \variable QStyleOptionSlider::pageStep
2115 \brief the size of the page step of the slider
2116
2117 The default value is 0.
2118
2119 \sa QAbstractSlider::pageStep
2120*/
2121#endif // QT_CONFIG(slider)
2122
2123#if QT_CONFIG(spinbox)
2124/*!
2125 \class QStyleOptionSpinBox
2126 \brief The QStyleOptionSpinBox class is used to describe the
2127 parameters necessary for drawing a spin box.
2128
2129 \inmodule QtWidgets
2130
2131 QStyleOptionSpinBox contains all the information that QStyle
2132 functions need to draw QSpinBox and QDateTimeEdit.
2133
2134 For performance reasons, there are few member functions and the
2135 access to the member variables is direct (i.e., using the \c . or
2136 \c -> operator). This makes the structures straightforward to use
2137 and emphasizes that these are simply parameters used by the style
2138 functions.
2139
2140 \sa QStyleOption, QStyleOptionComplex
2141*/
2142
2143/*!
2144 Constructs a QStyleOptionSpinBox, initializing the members
2145 variables to their default values.
2146*/
2147
2148QStyleOptionSpinBox::QStyleOptionSpinBox()
2149 : QStyleOptionSpinBox(Version)
2150{
2151}
2152
2153/*!
2154 \internal
2155*/
2156QStyleOptionSpinBox::QStyleOptionSpinBox(int version)
2157 : QStyleOptionComplex(version, SO_SpinBox), buttonSymbols(QAbstractSpinBox::UpDownArrows),
2158 stepEnabled(QAbstractSpinBox::StepNone), frame(false)
2159{
2160}
2161
2162/*!
2163 \fn QStyleOptionSpinBox::QStyleOptionSpinBox(const QStyleOptionSpinBox &other)
2164
2165 Constructs a copy of the \a other style option.
2166*/
2167
2168/*!
2169 \enum QStyleOptionSpinBox::StyleOptionType
2170
2171 This enum is used to hold information about the type of the style option, and
2172 is defined for each QStyleOption subclass.
2173
2174 \value Type The type of style option provided (\l{SO_SpinBox} for this class).
2175
2176 The type is used internally by QStyleOption, its subclasses, and
2177 qstyleoption_cast() to determine the type of style option. In
2178 general you do not need to worry about this unless you want to
2179 create your own QStyleOption subclass and your own styles.
2180
2181 \sa StyleOptionVersion
2182*/
2183
2184/*!
2185 \enum QStyleOptionSpinBox::StyleOptionVersion
2186
2187 This enum is used to hold information about the version of the style option, and
2188 is defined for each QStyleOption subclass.
2189
2190 \value Version 1
2191
2192 The version is used by QStyleOption subclasses to implement
2193 extensions without breaking compatibility. If you use
2194 qstyleoption_cast(), you normally do not need to check it.
2195
2196 \sa StyleOptionType
2197*/
2198
2199/*!
2200 \variable QStyleOptionSpinBox::buttonSymbols
2201 \brief the type of button symbols to draw for the spin box
2202
2203 The default value is QAbstractSpinBox::UpDownArrows specufying
2204 little arrows in the classic style.
2205
2206 \sa QAbstractSpinBox::ButtonSymbols
2207*/
2208
2209/*!
2210 \variable QStyleOptionSpinBox::stepEnabled
2211 \brief which buttons of the spin box that are enabled
2212
2213 The default value is QAbstractSpinBox::StepNone.
2214
2215 \sa QAbstractSpinBox::StepEnabled
2216*/
2217
2218/*!
2219 \variable QStyleOptionSpinBox::frame
2220 \brief whether the spin box has a frame
2221
2222 The default value is false, i.e. the spin box has no frame.
2223*/
2224#endif // QT_CONFIG(spinbox)
2225
2226/*!
2227 \class QStyleOptionDockWidget
2228 \brief The QStyleOptionDockWidget class is used to describe the
2229 parameters for drawing a dock widget.
2230
2231 \inmodule QtWidgets
2232
2233 QStyleOptionDockWidget contains all the information that QStyle
2234 functions need to draw graphical elements like QDockWidget.
2235
2236 For performance reasons, there are few member functions and the
2237 access to the member variables is direct (i.e., using the \c . or
2238 \c -> operator). This makes the structures straightforward to use
2239 and emphasizes that these are simply parameters used by the style
2240 functions.
2241
2242 \sa QStyleOption
2243*/
2244
2245/*!
2246 Constructs a QStyleOptionDockWidget, initializing the member
2247 variables to their default values.
2248*/
2249
2250QStyleOptionDockWidget::QStyleOptionDockWidget()
2251 : QStyleOptionDockWidget(Version)
2252{
2253}
2254
2255/*!
2256 \internal
2257*/
2258QStyleOptionDockWidget::QStyleOptionDockWidget(int version)
2259 : QStyleOption(version, SO_DockWidget), closable(false),
2260 movable(false), floatable(false), verticalTitleBar(false)
2261{
2262}
2263
2264/*!
2265 \fn QStyleOptionDockWidget::QStyleOptionDockWidget(const QStyleOptionDockWidget &other)
2266
2267 Constructs a copy of the \a other style option.
2268*/
2269
2270/*!
2271 \enum QStyleOptionDockWidget::StyleOptionType
2272
2273 This enum is used to hold information about the type of the style option, and
2274 is defined for each QStyleOption subclass.
2275
2276 \value Type The type of style option provided (\l{SO_DockWidget} for this class).
2277
2278 The type is used internally by QStyleOption, its subclasses, and
2279 qstyleoption_cast() to determine the type of style option. In
2280 general you do not need to worry about this unless you want to
2281 create your own QStyleOption subclass and your own styles.
2282
2283 \sa StyleOptionVersion
2284*/
2285
2286/*!
2287 \enum QStyleOptionDockWidget::StyleOptionVersion
2288
2289 This enum is used to hold information about the version of the style option, and
2290 is defined for each QStyleOption subclass.
2291
2292 \value Version 2
2293
2294 The version is used by QStyleOption subclasses to implement
2295 extensions without breaking compatibility. If you use
2296 qstyleoption_cast(), you normally do not need to check it.
2297
2298 \sa StyleOptionType
2299*/
2300
2301/*!
2302 \variable QStyleOptionDockWidget::title
2303 \brief the title of the dock window
2304
2305 The default value is an empty string.
2306*/
2307
2308/*!
2309 \variable QStyleOptionDockWidget::closable
2310 \brief whether the dock window is closable
2311
2312 The default value is true.
2313*/
2314
2315/*!
2316 \variable QStyleOptionDockWidget::movable
2317 \brief whether the dock window is movable
2318
2319 The default value is false.
2320*/
2321
2322/*!
2323 \variable QStyleOptionDockWidget::floatable
2324 \brief whether the dock window is floatable
2325
2326 The default value is true.
2327*/
2328
2329#if QT_CONFIG(toolbutton)
2330/*!
2331 \class QStyleOptionToolButton
2332 \brief The QStyleOptionToolButton class is used to describe the
2333 parameters for drawing a tool button.
2334
2335 \inmodule QtWidgets
2336
2337 QStyleOptionToolButton contains all the information that QStyle
2338 functions need to draw QToolButton.
2339
2340 For performance reasons, there are few member functions and the
2341 access to the member variables is direct (i.e., using the \c . or
2342 \c -> operator). This makes the structures straightforward to use
2343 and emphasizes that these are simply parameters used by the style
2344 functions.
2345
2346 \sa QStyleOption, QStyleOptionComplex, QStyleOptionButton
2347*/
2348
2349/*!
2350 \enum QStyleOptionToolButton::ToolButtonFeature
2351 Describes the various features that a tool button can have.
2352
2353 \value None A normal tool button.
2354 \value Arrow The tool button is an arrow.
2355 \value Menu The tool button has a menu.
2356 \value PopupDelay There is a delay to showing the menu.
2357 \value HasMenu The button has a popup menu.
2358 \value MenuButtonPopup The button should display an arrow to
2359 indicate that a menu is present.
2360
2361 \sa features, QToolButton::toolButtonStyle(), QToolButton::popupMode()
2362*/
2363
2364/*!
2365 Constructs a QStyleOptionToolButton, initializing the members
2366 variables to their default values.
2367*/
2368
2369QStyleOptionToolButton::QStyleOptionToolButton()
2370 : QStyleOptionToolButton(Version)
2371{
2372}
2373
2374/*!
2375 \internal
2376*/
2377QStyleOptionToolButton::QStyleOptionToolButton(int version)
2378 : QStyleOptionComplex(version, SO_ToolButton), features(None), arrowType(Qt::DownArrow)
2379 , toolButtonStyle(Qt::ToolButtonIconOnly)
2380
2381{
2382}
2383
2384/*!
2385 \fn QStyleOptionToolButton::QStyleOptionToolButton(const QStyleOptionToolButton &other)
2386
2387 Constructs a copy of the \a other style option.
2388*/
2389
2390/*!
2391 \enum QStyleOptionToolButton::StyleOptionType
2392
2393 This enum is used to hold information about the type of the style option, and
2394 is defined for each QStyleOption subclass.
2395
2396 \value Type The type of style option provided (\l{SO_ToolButton} for this class).
2397
2398 The type is used internally by QStyleOption, its subclasses, and
2399 qstyleoption_cast() to determine the type of style option. In
2400 general you do not need to worry about this unless you want to
2401 create your own QStyleOption subclass and your own styles.
2402
2403 \sa StyleOptionVersion
2404*/
2405
2406/*!
2407 \enum QStyleOptionToolButton::StyleOptionVersion
2408
2409 This enum is used to hold information about the version of the style option, and
2410 is defined for each QStyleOption subclass.
2411
2412 \value Version 1
2413
2414 The version is used by QStyleOption subclasses to implement
2415 extensions without breaking compatibility. If you use
2416 qstyleoption_cast(), you normally do not need to check it.
2417
2418 \sa StyleOptionType
2419*/
2420
2421/*!
2422 \variable QStyleOptionToolButton::features
2423 \brief an OR combination of the tool button's features
2424
2425 The default value is \l None.
2426
2427 \sa ToolButtonFeature
2428*/
2429
2430/*!
2431 \variable QStyleOptionToolButton::icon
2432 \brief the icon for the tool button
2433
2434 The default value is an empty icon, i.e. an icon with neither a
2435 pixmap nor a filename.
2436
2437 \sa iconSize
2438*/
2439
2440/*!
2441 \variable QStyleOptionToolButton::iconSize
2442 \brief the size of the icon for the tool button
2443
2444 The default value is QSize(-1, -1), i.e. an invalid size.
2445*/
2446
2447/*!
2448 \variable QStyleOptionToolButton::text
2449 \brief the text of the tool button
2450
2451 This value is only used if toolButtonStyle is
2452 Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
2453 Qt::ToolButtonTextOnly. The default value is an empty string.
2454*/
2455
2456/*!
2457 \variable QStyleOptionToolButton::arrowType
2458 \brief the direction of the arrow for the tool button
2459
2460 This value is only used if \l features includes \l Arrow. The
2461 default value is Qt::DownArrow.
2462*/
2463
2464/*!
2465 \variable QStyleOptionToolButton::toolButtonStyle
2466 \brief a Qt::ToolButtonStyle value describing the appearance of
2467 the tool button
2468
2469 The default value is Qt::ToolButtonIconOnly.
2470
2471 \sa QToolButton::toolButtonStyle()
2472*/
2473
2474/*!
2475 \variable QStyleOptionToolButton::pos
2476 \brief the position of the tool button
2477
2478 The default value is a null point, i.e. (0, 0)
2479*/
2480
2481/*!
2482 \variable QStyleOptionToolButton::font
2483 \brief the font that is used for the text
2484
2485 This value is only used if toolButtonStyle is
2486 Qt::ToolButtonTextUnderIcon, Qt::ToolButtonTextBesideIcon, or
2487 Qt::ToolButtonTextOnly. By default, the application's default font
2488 is used.
2489*/
2490#endif // QT_CONFIG(toolbutton)
2491
2492/*!
2493 \class QStyleOptionComboBox
2494 \brief The QStyleOptionComboBox class is used to describe the
2495 parameter for drawing a combobox.
2496
2497 \inmodule QtWidgets
2498
2499 QStyleOptionButton contains all the information that QStyle
2500 functions need to draw QComboBox.
2501
2502 For performance reasons, there are few member functions and the
2503 access to the member variables is direct (i.e., using the \c . or
2504 \c -> operator). This makes the structures straightforward to use
2505 and emphasizes that these are simply parameters used by the style
2506 functions.
2507
2508 \sa QStyleOption, QStyleOptionComplex, QComboBox
2509*/
2510
2511/*!
2512 Creates a QStyleOptionComboBox, initializing the members variables
2513 to their default values.
2514*/
2515
2516QStyleOptionComboBox::QStyleOptionComboBox()
2517 : QStyleOptionComboBox(Version)
2518{
2519}
2520
2521/*!
2522 \internal
2523*/
2524QStyleOptionComboBox::QStyleOptionComboBox(int version)
2525 : QStyleOptionComplex(version, SO_ComboBox), editable(false), frame(true)
2526{
2527}
2528
2529/*!
2530 \fn QStyleOptionComboBox::QStyleOptionComboBox(const QStyleOptionComboBox &other)
2531
2532 Constructs a copy of the \a other style option.
2533*/
2534
2535/*!
2536 \enum QStyleOptionComboBox::StyleOptionType
2537
2538 This enum is used to hold information about the type of the style option, and
2539 is defined for each QStyleOption subclass.
2540
2541 \value Type The type of style option provided (\l{SO_ComboBox} for this class).
2542
2543 The type is used internally by QStyleOption, its subclasses, and
2544 qstyleoption_cast() to determine the type of style option. In
2545 general you do not need to worry about this unless you want to
2546 create your own QStyleOption subclass and your own styles.
2547
2548 \sa StyleOptionVersion
2549*/
2550
2551/*!
2552 \enum QStyleOptionComboBox::StyleOptionVersion
2553
2554 This enum is used to hold information about the version of the style option, and
2555 is defined for each QStyleOption subclass.
2556
2557 \value Version 2
2558
2559 The version is used by QStyleOption subclasses to implement
2560 extensions without breaking compatibility. If you use
2561 qstyleoption_cast(), you normally do not need to check it.
2562
2563 \sa StyleOptionType
2564*/
2565
2566/*!
2567 \variable QStyleOptionComboBox::editable
2568 \brief whether or not the combobox is editable or not
2569
2570 the default
2571 value is false
2572
2573 \sa QComboBox::isEditable()
2574*/
2575
2576
2577/*!
2578 \variable QStyleOptionComboBox::frame
2579 \brief whether the combo box has a frame
2580
2581 The default value is true.
2582*/
2583
2584/*!
2585 \variable QStyleOptionComboBox::currentText
2586 \brief the text for the current item of the combo box
2587
2588 The default value is an empty string.
2589*/
2590
2591/*!
2592 \variable QStyleOptionComboBox::currentIcon
2593 \brief the icon for the current item of the combo box
2594
2595 The default value is an empty icon, i.e. an icon with neither a
2596 pixmap nor a filename.
2597*/
2598
2599/*!
2600 \variable QStyleOptionComboBox::iconSize
2601 \brief the icon size for the current item of the combo box
2602
2603 The default value is QSize(-1, -1), i.e. an invalid size.
2604*/
2605
2606/*!
2607 \variable QStyleOptionComboBox::popupRect
2608 \brief the popup rectangle for the combobox
2609
2610 The default value is a null rectangle, i.e. a rectangle with both
2611 the width and the height set to 0.
2612
2613 This variable is currently unused. You can safely ignore it.
2614
2615 \sa QStyle::SC_ComboBoxListBoxPopup
2616*/
2617
2618/*!
2619 \variable QStyleOptionComboBox::textAlignment
2620 \brief the alignment of the current text in the combo box
2621
2622 The default value is Qt::AlignLeft | Qt::AlignVCenter.
2623*/
2624
2625/*!
2626 \class QStyleOptionToolBox
2627 \brief The QStyleOptionToolBox class is used to describe the
2628 parameters needed for drawing a tool box.
2629
2630 \inmodule QtWidgets
2631
2632 QStyleOptionToolBox contains all the information that QStyle
2633 functions need to draw QToolBox.
2634
2635 For performance reasons, there are few member functions and the
2636 access to the member variables is direct (i.e., using the \c . or
2637 \c -> operator). This makes the structures straightforward to use
2638 and emphasizes that these are simply parameters used by the style
2639 functions.
2640
2641 \sa QStyleOption, QToolBox
2642*/
2643
2644/*!
2645 Creates a QStyleOptionToolBox, initializing the members variables
2646 to their default values.
2647*/
2648
2649QStyleOptionToolBox::QStyleOptionToolBox()
2650 : QStyleOptionToolBox(Version)
2651{
2652}
2653
2654/*!
2655 \internal
2656*/
2657QStyleOptionToolBox::QStyleOptionToolBox(int version)
2658 : QStyleOption(version, SO_ToolBox), position(Beginning), selectedPosition(NotAdjacent)
2659{
2660}
2661
2662/*!
2663 \fn QStyleOptionToolBox::QStyleOptionToolBox(const QStyleOptionToolBox &other)
2664
2665 Constructs a copy of the \a other style option.
2666*/
2667
2668/*!
2669 \enum QStyleOptionToolBox::StyleOptionType
2670
2671 This enum is used to hold information about the type of the style option, and
2672 is defined for each QStyleOption subclass.
2673
2674 \value Type The type of style option provided (\l{SO_ToolBox} for this class).
2675
2676 The type is used internally by QStyleOption, its subclasses, and
2677 qstyleoption_cast() to determine the type of style option. In
2678 general you do not need to worry about this unless you want to
2679 create your own QStyleOption subclass and your own styles.
2680
2681 \sa StyleOptionVersion
2682*/
2683
2684/*!
2685 \enum QStyleOptionToolBox::StyleOptionVersion
2686
2687 This enum is used to hold information about the version of the style option, and
2688 is defined for each QStyleOption subclass.
2689
2690 \value Version 2
2691
2692 The version is used by QStyleOption subclasses to implement
2693 extensions without breaking compatibility. If you use
2694 qstyleoption_cast(), you normally do not need to check it.
2695
2696 \sa StyleOptionType
2697*/
2698
2699/*!
2700 \variable QStyleOptionToolBox::icon
2701 \brief the icon for the tool box tab
2702
2703 The default value is an empty icon, i.e. an icon with neither a
2704 pixmap nor a filename.
2705*/
2706
2707/*!
2708 \variable QStyleOptionToolBox::text
2709 \brief the text for the tool box tab
2710
2711 The default value is an empty string.
2712*/
2713
2714/*!
2715 \enum QStyleOptionToolBox::SelectedPosition
2716
2717 This enum describes the position of the selected tab. Some styles
2718 need to draw a tab differently depending on whether or not it is
2719 adjacent to the selected tab.
2720
2721 \value NotAdjacent The tab is not adjacent to a selected tab (or is the selected tab).
2722 \value NextIsSelected The next tab (typically the tab on the right) is selected.
2723 \value PreviousIsSelected The previous tab (typically the tab on the left) is selected.
2724
2725 \sa selectedPosition
2726*/
2727
2728/*!
2729 \enum QStyleOptionToolBox::TabPosition
2730
2731 This enum describes tab positions relative to other tabs.
2732
2733 \value Beginning The tab is the first (i.e., top-most) tab in
2734 the toolbox.
2735 \value Middle The tab is placed in the middle of the toolbox.
2736 \value End The tab is placed at the bottom of the toolbox.
2737 \value OnlyOneTab There is only one tab in the toolbox.
2738*/
2739
2740/*!
2741 \variable QStyleOptionToolBox::selectedPosition
2742 \brief the position of the selected tab in relation to this tab
2743
2744 The default value is NotAdjacent, i.e. the tab is not adjacent to
2745 a selected tab nor is it the selected tab.
2746*/
2747
2748#if QT_CONFIG(rubberband)
2749/*!
2750 \class QStyleOptionRubberBand
2751 \brief The QStyleOptionRubberBand class is used to describe the
2752 parameters needed for drawing a rubber band.
2753
2754 \inmodule QtWidgets
2755
2756 QStyleOptionRubberBand contains all the information that
2757 QStyle functions need to draw QRubberBand.
2758
2759 For performance reasons, there are few member functions and the
2760 access to the member variables is direct (i.e., using the \c . or
2761 \c -> operator). This makes the structures straightforward to use
2762 and emphasizes that these are simply parameters used by the style
2763 functions.
2764
2765 \sa QStyleOption, QRubberBand
2766*/
2767
2768/*!
2769 Creates a QStyleOptionRubberBand, initializing the members
2770 variables to their default values.
2771*/
2772
2773QStyleOptionRubberBand::QStyleOptionRubberBand()
2774 : QStyleOptionRubberBand(Version)
2775{
2776}
2777
2778/*!
2779 \internal
2780*/
2781QStyleOptionRubberBand::QStyleOptionRubberBand(int version)
2782 : QStyleOption(version, SO_RubberBand), shape(QRubberBand::Line), opaque(false)
2783{
2784}
2785
2786/*!
2787 \fn QStyleOptionRubberBand::QStyleOptionRubberBand(const QStyleOptionRubberBand &other)
2788
2789 Constructs a copy of the \a other style option.
2790*/
2791
2792/*!
2793 \enum QStyleOptionRubberBand::StyleOptionType
2794
2795 This enum is used to hold information about the type of the style option, and
2796 is defined for each QStyleOption subclass.
2797
2798 \value Type The type of style option provided (\l{SO_RubberBand} for this class).
2799
2800 The type is used internally by QStyleOption, its subclasses, and
2801 qstyleoption_cast() to determine the type of style option. In
2802 general you do not need to worry about this unless you want to
2803 create your own QStyleOption subclass and your own styles.
2804
2805 \sa StyleOptionVersion
2806*/
2807
2808/*!
2809 \enum QStyleOptionRubberBand::StyleOptionVersion
2810
2811 This enum is used to hold information about the version of the style option, and
2812 is defined for each QStyleOption subclass.
2813
2814 \value Version 1
2815
2816 The version is used by QStyleOption subclasses to implement
2817 extensions without breaking compatibility. If you use
2818 qstyleoption_cast(), you normally do not need to check it.
2819
2820 \sa StyleOptionType
2821*/
2822
2823/*!
2824 \variable QStyleOptionRubberBand::shape
2825 \brief the shape of the rubber band
2826
2827 The default shape is QRubberBand::Line.
2828*/
2829
2830/*!
2831 \variable QStyleOptionRubberBand::opaque
2832 \brief whether the rubber band is required to be drawn in an opaque style
2833
2834 The default value is true.
2835*/
2836#endif // QT_CONFIG(rubberband)
2837
2838/*!
2839 \class QStyleOptionTitleBar
2840 \brief The QStyleOptionTitleBar class is used to describe the
2841 parameters for drawing a title bar.
2842
2843 \inmodule QtWidgets
2844
2845 QStyleOptionTitleBar contains all the information that QStyle
2846 functions need to draw the title bar of a QMdiSubWindow.
2847
2848 For performance reasons, there are few member functions and the
2849 access to the member variables is direct (i.e., using the \c . or
2850 \c -> operator). This makes the structures straightforward to use
2851 and emphasizes that these are simply parameters used by the style
2852 functions.
2853
2854 \sa QStyleOption, QStyleOptionComplex, QMdiSubWindow
2855*/
2856
2857/*!
2858 Constructs a QStyleOptionTitleBar, initializing the members
2859 variables to their default values.
2860*/
2861
2862QStyleOptionTitleBar::QStyleOptionTitleBar()
2863 : QStyleOptionTitleBar(Version)
2864{
2865}
2866
2867/*!
2868 \fn QStyleOptionTitleBar::QStyleOptionTitleBar(const QStyleOptionTitleBar &other)
2869
2870 Constructs a copy of the \a other style option.
2871*/
2872
2873/*!
2874 \enum QStyleOptionTitleBar::StyleOptionType
2875
2876 This enum is used to hold information about the type of the style option, and
2877 is defined for each QStyleOption subclass.
2878
2879 \value Type The type of style option provided (\l{SO_TitleBar} for this class).
2880
2881 The type is used internally by QStyleOption, its subclasses, and
2882 qstyleoption_cast() to determine the type of style option. In
2883 general you do not need to worry about this unless you want to
2884 create your own QStyleOption subclass and your own styles.
2885
2886 \sa StyleOptionVersion
2887*/
2888
2889/*!
2890 \enum QStyleOptionTitleBar::StyleOptionVersion
2891
2892 This enum is used to hold information about the version of the style option, and
2893 is defined for each QStyleOption subclass.
2894
2895 \value Version 1
2896
2897 The version is used by QStyleOption subclasses to implement
2898 extensions without breaking compatibility. If you use
2899 qstyleoption_cast(), you normally do not need to check it.
2900
2901 \sa StyleOptionType
2902*/
2903
2904/*!
2905 \internal
2906*/
2907QStyleOptionTitleBar::QStyleOptionTitleBar(int version)
2908 : QStyleOptionComplex(version, SO_TitleBar), titleBarState(0)
2909{
2910}
2911
2912
2913/*!
2914 \variable QStyleOptionTitleBar::text
2915 \brief the text of the title bar
2916
2917 The default value is an empty string.
2918*/
2919
2920/*!
2921 \variable QStyleOptionTitleBar::icon
2922 \brief the icon for the title bar
2923
2924 The default value is an empty icon, i.e. an icon with neither a
2925 pixmap nor a filename.
2926*/
2927
2928/*!
2929 \variable QStyleOptionTitleBar::titleBarState
2930 \brief the state of the title bar
2931
2932 This is basically the window state of the underlying widget. The
2933 default value is 0.
2934
2935 \sa QWidget::windowState()
2936*/
2937
2938/*!
2939 \variable QStyleOptionTitleBar::titleBarFlags
2940 \brief the widget flags for the title bar
2941
2942 The default value is Qt::Widget.
2943
2944 \sa Qt::WindowFlags
2945*/
2946
2947#if QT_CONFIG(itemviews)
2948/*!
2949 \class QStyleOptionViewItem
2950 \brief The QStyleOptionViewItem class is used to describe the
2951 parameters used to draw an item in a view widget.
2952
2953 \inmodule QtWidgets
2954
2955 QStyleOptionViewItem contains all the information that QStyle
2956 functions need to draw the items for Qt's model/view classes.
2957
2958 For performance reasons, there are few member functions and the
2959 access to the member variables is direct (i.e., using the \c . or
2960 \c -> operator). This makes the structures straightforward to use
2961 and emphasizes that these are simply parameters used by the style
2962 functions.
2963
2964 \sa QStyleOption, {model-view-programming.html}{Model/View
2965 Programming}
2966*/
2967
2968/*!
2969 \enum QStyleOptionViewItem::Position
2970
2971 This enum describes the position of the item's decoration.
2972
2973 \value Left On the left of the text.
2974 \value Right On the right of the text.
2975 \value Top Above the text.
2976 \value Bottom Below the text.
2977
2978 \sa decorationPosition
2979*/
2980
2981/*!
2982 \variable QStyleOptionViewItem::showDecorationSelected
2983 \brief whether the decoration should be highlighted on selected
2984 items
2985
2986 If this option is true, the branch and any decorations on selected items
2987 should be highlighted, indicating that the item is selected; otherwise, no
2988 highlighting is required. The default value is false.
2989
2990 \sa QStyle::SH_ItemView_ShowDecorationSelected, QAbstractItemView
2991*/
2992
2993/*!
2994 \variable QStyleOptionViewItem::locale
2995 \brief the locale to use for displaying text, numbers and dates.
2996
2997 This allows the style to display e.g. dates in a different locale than
2998 the default locale of the application.
2999*/
3000
3001/*!
3002 \variable QStyleOptionViewItem::widget
3003 \brief the parent widget of the item
3004
3005 This member contains the parent widget (itemview) of the item to
3006 be able to e.g. access some properties within the QStyledItemDelegate
3007 methods.
3008*/
3009
3010/*!
3011 \variable QStyleOptionViewItem::textElideMode
3012 \brief where ellipsis should be added for text that is too long to fit
3013 into an item
3014
3015 The default value is Qt::ElideMiddle, i.e. the ellipsis appears in
3016 the middle of the text.
3017
3018 \sa Qt::TextElideMode, QStyle::SH_ItemView_EllipsisLocation
3019*/
3020
3021/*!
3022 Constructs a QStyleOptionViewItem, initializing the members
3023 variables to their default values.
3024*/
3025
3026QStyleOptionViewItem::QStyleOptionViewItem()
3027 : QStyleOptionViewItem(Version)
3028{
3029}
3030
3031/*!
3032 \internal
3033*/
3034QStyleOptionViewItem::QStyleOptionViewItem(int version)
3035 : QStyleOption(version, SO_ViewItem),
3036 displayAlignment(Qt::AlignLeft), decorationAlignment(Qt::AlignLeft),
3037 textElideMode(Qt::ElideMiddle), decorationPosition(Left),
3038 showDecorationSelected(false), features(None), widget(nullptr),
3039 checkState(Qt::Unchecked), viewItemPosition(QStyleOptionViewItem::Invalid)
3040{
3041}
3042
3043/*!
3044 \fn QStyleOptionViewItem::QStyleOptionViewItem(const QStyleOptionViewItem &other)
3045
3046 Constructs a copy of the \a other style option.
3047*/
3048
3049/*!
3050 \enum QStyleOptionViewItem::StyleOptionType
3051
3052 This enum is used to hold information about the type of the style option, and
3053 is defined for each QStyleOption subclass.
3054
3055 \value Type The type of style option provided (\l{SO_ViewItem} for this class).
3056
3057 The type is used internally by QStyleOption, its subclasses, and
3058 qstyleoption_cast() to determine the type of style option. In
3059 general you do not need to worry about this unless you want to
3060 create your own QStyleOption subclass and your own styles.
3061
3062 \sa StyleOptionVersion
3063*/
3064
3065/*!
3066 \enum QStyleOptionViewItem::StyleOptionVersion
3067
3068 This enum is used to hold information about the version of the style option, and
3069 is defined for each QStyleOption subclass.
3070
3071 \value Version 4
3072
3073 The version is used by QStyleOption subclasses to implement
3074 extensions without breaking compatibility. If you use
3075 qstyleoption_cast(), you normally do not need to check it.
3076
3077 \sa StyleOptionType
3078*/
3079
3080/*!
3081 \variable QStyleOptionViewItem::displayAlignment
3082 \brief the alignment of the display value for the item
3083
3084 The default value is Qt::AlignLeft.
3085*/
3086
3087/*!
3088 \variable QStyleOptionViewItem::decorationAlignment
3089 \brief the alignment of the decoration for the item
3090
3091 The default value is Qt::AlignLeft.
3092*/
3093
3094/*!
3095 \variable QStyleOptionViewItem::decorationPosition
3096 \brief the position of the decoration for the item
3097
3098 The default value is \l Left.
3099
3100 \sa Position
3101*/
3102
3103/*!
3104 \variable QStyleOptionViewItem::decorationSize
3105 \brief the size of the decoration for the item
3106
3107 The default value is QSize(-1, -1), i.e. an invalid size.
3108
3109 \sa decorationAlignment, decorationPosition
3110*/
3111
3112/*!
3113 \variable QStyleOptionViewItem::font
3114 \brief the font used for the item
3115
3116 By default, the application's default font is used.
3117
3118 \sa QFont
3119*/
3120
3121/*!
3122 \variable QStyleOptionViewItem::features
3123 \brief a bitwise OR of the features that describe this view item
3124
3125 \sa ViewItemFeature
3126*/
3127
3128/*!
3129 \enum QStyleOptionViewItem::ViewItemFeature
3130
3131 This enum describes the different types of features an item can have.
3132
3133 \value None Indicates a normal item.
3134 \value WrapText Indicates an item with wrapped text.
3135 \value Alternate Indicates that the item's background is rendered using alternateBase.
3136 \value HasCheckIndicator Indicates that the item has a check state indicator.
3137 \value HasDisplay Indicates that the item has a display role.
3138 \value HasDecoration Indicates that the item has a decoration role.
3139 \value [since 6.9] IsDecoratedRootColumn Indicates that the item has a tree view branch
3140 part for painting.
3141 \value [since 6.9] IsDecorationForRootColumn Indicates that the item contains the
3142 information to draw the tree view branch part.
3143*/
3144
3145/*!
3146 \variable QStyleOptionViewItem::index
3147
3148 The model index that is to be drawn.
3149*/
3150
3151/*!
3152 \variable QStyleOptionViewItem::checkState
3153
3154 If this view item is checkable, i.e.,
3155 ViewItemFeature::HasCheckIndicator is true, \c checkState is true
3156 if the item is checked; otherwise, it is false.
3157
3158*/
3159
3160/*!
3161 \variable QStyleOptionViewItem::icon
3162
3163 The icon (if any) to be drawn in the view item.
3164*/
3165
3166
3167/*!
3168 \variable QStyleOptionViewItem::text
3169
3170 The text (if any) to be drawn in the view item.
3171*/
3172
3173/*!
3174 \variable QStyleOptionViewItem::backgroundBrush
3175
3176 The QBrush that should be used to paint the view items
3177 background.
3178*/
3179
3180/*!
3181 \variable QStyleOptionViewItem::viewItemPosition
3182
3183 Gives the position of this view item relative to other items. See
3184 the \l{QStyleOptionViewItem::}{ViewItemPosition} enum for the
3185 details.
3186*/
3187
3188/*!
3189 \enum QStyleOptionViewItem::ViewItemPosition
3190
3191 This enum is used to represent the placement of the item on
3192 a row. This can be used to draw items differently depending
3193 on their placement, for example by putting rounded edges at
3194 the beginning and end, and straight edges in between.
3195
3196 \value Invalid The ViewItemPosition is unknown and should be
3197 disregarded.
3198 \value Beginning The item appears at the beginning of the row.
3199 \value Middle The item appears in the middle of the row.
3200 \value End The item appears at the end of the row.
3201 \value OnlyOne The item is the only one on the row, and is
3202 therefore both at the beginning and the end.
3203*/
3204
3205#endif // QT_CONFIG(itemviews)
3206/*!
3207 \fn template <typename T> T qstyleoption_cast<T>(const QStyleOption *option)
3208 \relates QStyleOption
3209
3210 Returns a T or \nullptr depending on the \l{QStyleOption::type}{type} and
3211 \l{QStyleOption::version}{version} of the given \a option.
3212
3213 Example:
3214
3215 \snippet qstyleoption/main.cpp 4
3216
3217 \sa QStyleOption::type, QStyleOption::version
3218*/
3219
3220/*!
3221 \fn template <typename T> T qstyleoption_cast<T>(QStyleOption *option)
3222 \overload
3223 \relates QStyleOption
3224
3225 Returns a T or \nullptr depending on the type of the given \a option.
3226*/
3227
3228#if QT_CONFIG(tabwidget)
3229/*!
3230 \class QStyleOptionTabWidgetFrame
3231 \brief The QStyleOptionTabWidgetFrame class is used to describe the
3232 parameters for drawing the frame around a tab widget.
3233
3234 \inmodule QtWidgets
3235
3236 QStyleOptionTabWidgetFrame contains all the information that
3237 QStyle functions need to draw the frame around QTabWidget.
3238
3239 For performance reasons, there are few member functions and the
3240 access to the member variables is direct (i.e., using the \c . or
3241 \c -> operator). This makes the structures straightforward to use
3242 and emphasizes that these are simply parameters used by the style
3243 functions.
3244
3245 \sa QStyleOption, QTabWidget
3246*/
3247
3248/*!
3249 Constructs a QStyleOptionTabWidgetFrame, initializing the members
3250 variables to their default values.
3251*/
3252QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame()
3253 : QStyleOptionTabWidgetFrame(Version)
3254{
3255}
3256
3257/*!
3258 \fn QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(const QStyleOptionTabWidgetFrame &other)
3259
3260 Constructs a copy of \a other.
3261*/
3262
3263/*! \internal */
3264QStyleOptionTabWidgetFrame::QStyleOptionTabWidgetFrame(int version)
3265 : QStyleOption(version, SO_TabWidgetFrame), lineWidth(0), midLineWidth(0),
3266 shape(QTabBar::RoundedNorth)
3267{
3268}
3269
3270/*!
3271 \enum QStyleOptionTabWidgetFrame::StyleOptionType
3272
3273 This enum is used to hold information about the type of the style option, and
3274 is defined for each QStyleOption subclass.
3275
3276 \value Type The type of style option provided (\l{SO_TabWidgetFrame} for this class).
3277
3278 The type is used internally by QStyleOption, its subclasses, and
3279 qstyleoption_cast() to determine the type of style option. In
3280 general you do not need to worry about this unless you want to
3281 create your own QStyleOption subclass and your own styles.
3282
3283 \sa StyleOptionVersion
3284*/
3285
3286/*!
3287 \enum QStyleOptionTabWidgetFrame::StyleOptionVersion
3288
3289 This enum is used to hold information about the version of the style option, and
3290 is defined for each QStyleOption subclass.
3291
3292 \value Version 2
3293
3294 The version is used by QStyleOption subclasses to implement
3295 extensions without breaking compatibility. If you use
3296 qstyleoption_cast(), you normally do not need to check it.
3297
3298 \sa StyleOptionType
3299*/
3300
3301/*!
3302 \variable QStyleOptionTabWidgetFrame::lineWidth
3303 \brief the line width for drawing the panel
3304
3305 The default value is 0.
3306*/
3307
3308/*!
3309 \variable QStyleOptionTabWidgetFrame::midLineWidth
3310 \brief the mid-line width for drawing the panel
3311
3312 The mid line width is usually used in drawing sunken or raised
3313 frames. The default value is 0.
3314*/
3315
3316/*!
3317 \variable QStyleOptionTabWidgetFrame::shape
3318 \brief the tab shape used to draw the tabs
3319
3320 The default value is QTabBar::RoundedNorth.
3321*/
3322
3323/*!
3324 \variable QStyleOptionTabWidgetFrame::tabBarSize
3325 \brief the size of the tab bar
3326
3327 The default value is QSize(-1, -1), i.e. an invalid size.
3328*/
3329
3330/*!
3331 \variable QStyleOptionTabWidgetFrame::rightCornerWidgetSize
3332 \brief the size of the right-corner widget
3333
3334 The default value is QSize(-1, -1), i.e. an invalid size.
3335*/
3336
3337/*! \variable QStyleOptionTabWidgetFrame::leftCornerWidgetSize
3338 \brief the size of the left-corner widget
3339
3340 The default value is QSize(-1, -1), i.e. an invalid size.
3341*/
3342
3343
3344/*!
3345 \variable QStyleOptionTabWidgetFrame::tabBarRect
3346 \brief the rectangle containing all the tabs
3347
3348 The default value is a null rectangle, i.e. a rectangle with both
3349 the width and the height set to 0.
3350*/
3351
3352/*!
3353 \variable QStyleOptionTabWidgetFrame::selectedTabRect
3354 \brief the rectangle containing the selected tab
3355
3356 This rectangle is contained within the tabBarRect. The default
3357 value is a null rectangle, i.e. a rectangle with both the width
3358 and the height set to 0.
3359*/
3360
3361#endif // QT_CONFIG(tabwidget)
3362
3363#if QT_CONFIG(tabbar)
3364
3365/*!
3366 \class QStyleOptionTabBarBase
3367 \brief The QStyleOptionTabBarBase class is used to describe
3368 the base of a tab bar, i.e. the part that the tab bar usually
3369 overlaps with.
3370
3371 \inmodule QtWidgets
3372
3373 QStyleOptionTabBarBase contains all the information that QStyle
3374 functions need to draw the tab bar base. Note that this is only
3375 drawn for a standalone QTabBar (one that isn't part of a
3376 QTabWidget).
3377
3378 For performance reasons, there are few member functions and the
3379 access to the member variables is direct (i.e., using the \c . or
3380 \c -> operator). This makes the structures straightforward to use
3381 and emphasizes that these are simply parameters used by the style
3382 functions.
3383
3384 \sa QStyleOption, QTabBar::drawBase()
3385*/
3386
3387/*!
3388 Construct a QStyleOptionTabBarBase, initializing the members
3389 variables to their default values.
3390*/
3391QStyleOptionTabBarBase::QStyleOptionTabBarBase()
3392 : QStyleOptionTabBarBase(Version)
3393{
3394}
3395
3396/*! \internal */
3397QStyleOptionTabBarBase::QStyleOptionTabBarBase(int version)
3398 : QStyleOption(version, SO_TabBarBase), shape(QTabBar::RoundedNorth),
3399 documentMode(false)
3400{
3401}
3402
3403/*!
3404 \fn QStyleOptionTabBarBase::QStyleOptionTabBarBase(const QStyleOptionTabBarBase &other)
3405
3406 Constructs a copy of \a other.
3407*/
3408
3409/*!
3410 \enum QStyleOptionTabBarBase::StyleOptionType
3411
3412 This enum is used to hold information about the type of the style option, and
3413 is defined for each QStyleOption subclass.
3414
3415 \value Type The type of style option provided (\l{SO_TabBarBase} for this class).
3416
3417 The type is used internally by QStyleOption, its subclasses, and
3418 qstyleoption_cast() to determine the type of style option. In
3419 general you do not need to worry about this unless you want to
3420 create your own QStyleOption subclass and your own styles.
3421
3422 \sa StyleOptionVersion
3423*/
3424
3425/*!
3426 \enum QStyleOptionTabBarBase::StyleOptionVersion
3427
3428 This enum is used to hold information about the version of the style option, and
3429 is defined for each QStyleOption subclass.
3430
3431 \value Version 2
3432
3433 The version is used by QStyleOption subclasses to implement
3434 extensions without breaking compatibility. If you use
3435 qstyleoption_cast(), you normally do not need to check it.
3436
3437 \sa StyleOptionType
3438*/
3439
3440/*!
3441 \variable QStyleOptionTabBarBase::shape
3442 \brief the shape of the tab bar
3443
3444 The default value is QTabBar::RoundedNorth.
3445*/
3446
3447/*!
3448 \variable QStyleOptionTabBarBase::tabBarRect
3449 \brief the rectangle containing all the tabs
3450
3451 The default value is a null rectangle, i.e. a rectangle with both
3452 the width and the height set to 0.
3453*/
3454
3455/*!
3456 \variable QStyleOptionTabBarBase::selectedTabRect
3457 \brief the rectangle containing the selected tab
3458
3459 This rectangle is contained within the tabBarRect. The default
3460 value is a null rectangle, i.e. a rectangle with both the width
3461 and the height set to 0.
3462*/
3463
3464
3465/*!
3466 \variable QStyleOptionTabBarBase::documentMode
3467 \brief whether the tabbar is in document mode.
3468
3469 The default value is false;
3470*/
3471
3472#endif // QT_CONFIG(tabbar)
3473
3474#if QT_CONFIG(sizegrip)
3475/*!
3476 \class QStyleOptionSizeGrip
3477 \brief The QStyleOptionSizeGrip class is used to describe the
3478 parameter for drawing a size grip.
3479 \since 4.2
3480 \inmodule QtWidgets
3481
3482 QStyleOptionButton contains all the information that QStyle
3483 functions need to draw QSizeGrip.
3484
3485 For performance reasons, there are few member functions and the
3486 access to the member variables is direct (i.e., using the \c . or
3487 \c -> operator). This makes the structures straightforward to use
3488 and emphasizes that these are simply parameters used by the style
3489 functions.
3490
3491 \sa QStyleOption, QStyleOptionComplex, QSizeGrip
3492*/
3493
3494/*!
3495 Constructs a QStyleOptionSizeGrip.
3496*/
3497QStyleOptionSizeGrip::QStyleOptionSizeGrip()
3498 : QStyleOptionSizeGrip(Version)
3499{
3500}
3501
3502/*!
3503 \fn QStyleOptionSizeGrip::QStyleOptionSizeGrip(const QStyleOptionSizeGrip &other)
3504
3505 Constructs a copy of the \a other style option.
3506*/
3507
3508/*!
3509 \internal
3510*/
3511QStyleOptionSizeGrip::QStyleOptionSizeGrip(int version)
3512 : QStyleOptionComplex(version, Type), corner(Qt::BottomRightCorner)
3513{
3514}
3515
3516/*!
3517 \variable QStyleOptionSizeGrip::corner
3518
3519 The corner in which the size grip is located.
3520*/
3521
3522/*!
3523 \enum QStyleOptionSizeGrip::StyleOptionType
3524
3525 This enum is used to hold information about the type of the style option, and
3526 is defined for each QStyleOption subclass.
3527
3528 \value Type The type of style option provided (\l{SO_TabBarBase} for this class).
3529
3530 The type is used internally by QStyleOption, its subclasses, and
3531 qstyleoption_cast() to determine the type of style option. In
3532 general you do not need to worry about this unless you want to
3533 create your own QStyleOption subclass and your own styles.
3534
3535 \sa StyleOptionVersion
3536*/
3537
3538/*!
3539 \enum QStyleOptionSizeGrip::StyleOptionVersion
3540
3541 This enum is used to hold information about the version of the style option, and
3542 is defined for each QStyleOption subclass.
3543
3544 \value Version 1
3545
3546 The version is used by QStyleOption subclasses to implement
3547 extensions without breaking compatibility. If you use
3548 qstyleoption_cast(), you normally do not need to check it.
3549
3550 \sa StyleOptionType
3551*/
3552#endif // QT_CONFIG(sizegrip)
3553
3554/*!
3555 \class QStyleOptionGraphicsItem
3556 \brief The QStyleOptionGraphicsItem class is used to describe
3557 the parameters needed to draw a QGraphicsItem.
3558 \since 4.2
3559 \ingroup graphicsview-api
3560 \inmodule QtWidgets
3561
3562 For performance reasons, there are few member functions and the
3563 access to the member variables is direct (i.e., using the \c . or
3564 \c -> operator). This makes the structures straightforward to use
3565 and emphasizes that these are simply parameters used by the style
3566 functions.
3567
3568 \sa QStyleOption, QGraphicsItem::paint()
3569*/
3570
3571/*!
3572 \enum QStyleOptionGraphicsItem::StyleOptionType
3573
3574 This enum is used to hold information about the type of the style option, and
3575 is defined for each QStyleOption subclass.
3576
3577 \value Type The type of style option provided (\l SO_GraphicsItem for this class).
3578
3579 The type is used internally by QStyleOption, its subclasses, and
3580 qstyleoption_cast() to determine the type of style option. In
3581 general you do not need to worry about this unless you want to
3582 create your own QStyleOption subclass and your own styles.
3583
3584 \sa StyleOptionVersion
3585*/
3586
3587/*!
3588 \enum QStyleOptionGraphicsItem::StyleOptionVersion
3589
3590 This enum is used to hold information about the version of the style option, and
3591 is defined for each QStyleOption subclass.
3592
3593 \value Version 1
3594
3595 The version is used by QStyleOption subclasses to implement
3596 extensions without breaking compatibility. If you use
3597 qstyleoption_cast(), you normally do not need to check it.
3598
3599 \sa StyleOptionType
3600*/
3601
3602/*!
3603 Constructs a QStyleOptionGraphicsItem.
3604*/
3605QStyleOptionGraphicsItem::QStyleOptionGraphicsItem()
3606 : QStyleOptionGraphicsItem(Version)
3607{
3608}
3609
3610/*!
3611 \internal
3612*/
3613QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(int version)
3614 : QStyleOption(version, Type)
3615{
3616}
3617
3618/*!
3619 \since 4.6
3620
3621 Returns the level of detail from the \a worldTransform.
3622
3623 Its value represents the maximum value of the height and
3624 width of a unity rectangle, mapped using the \a worldTransform
3625 of the painter used to draw the item. By default, if no
3626 transformations are applied, its value is 1. If zoomed out 1:2, the level
3627 of detail will be 0.5, and if zoomed in 2:1, its value is 2.
3628
3629 \sa QGraphicsScene::minimumRenderSize()
3630*/
3631qreal QStyleOptionGraphicsItem::levelOfDetailFromTransform(const QTransform &worldTransform)
3632{
3633 if (worldTransform.type() <= QTransform::TxTranslate)
3634 return 1; // Translation only? The LOD is 1.
3635
3636 // Two unit vectors.
3637 QLineF v1(0, 0, 1, 0);
3638 QLineF v2(0, 0, 0, 1);
3639 // LOD is the transformed area of a 1x1 rectangle.
3640 return qSqrt(worldTransform.map(v1).length() * worldTransform.map(v2).length());
3641}
3642
3643/*!
3644 \fn QStyleOptionGraphicsItem::QStyleOptionGraphicsItem(const QStyleOptionGraphicsItem &other)
3645
3646 Constructs a copy of \a other.
3647*/
3648
3649/*!
3650 \variable QStyleOptionGraphicsItem::exposedRect
3651 \brief the exposed rectangle, in item coordinates
3652
3653 Make use of this rectangle to speed up item drawing when only parts of the
3654 item are exposed. If the whole item is exposed, this rectangle will be the
3655 same as QGraphicsItem::boundingRect().
3656
3657 This member is only initialized for items that have the
3658 QGraphicsItem::ItemUsesExtendedStyleOption flag set.
3659*/
3660
3661/*!
3662 \class QStyleHintReturn
3663 \brief The QStyleHintReturn class provides style hints that return more
3664 than basic data types.
3665
3666 \ingroup appearance
3667 \inmodule QtWidgets
3668
3669 QStyleHintReturn and its subclasses are used to pass information
3670 from a style back to the querying widget. This is most useful
3671 when the return value from QStyle::styleHint() does not provide enough
3672 detail; for example, when a mask is to be returned.
3673*/
3674
3675/*!
3676 \enum QStyleHintReturn::HintReturnType
3677
3678 \value SH_Default QStyleHintReturn
3679 \value SH_Mask \l QStyle::SH_RubberBand_Mask QStyle::SH_FocusFrame_Mask
3680 \value SH_Variant \l QStyle::SH_TextControl_FocusIndicatorTextCharFormat
3681*/
3682
3683/*!
3684 \enum QStyleHintReturn::StyleOptionType
3685
3686 This enum is used to hold information about the type of the style option, and
3687 is defined for each QStyleHintReturn subclass.
3688
3689 \value Type The type of style option provided (\l SH_Default for
3690 this class).
3691
3692 The type is used internally by QStyleHintReturn, its subclasses, and
3693 qstyleoption_cast() to determine the type of style option. In
3694 general you do not need to worry about this unless you want to
3695 create your own QStyleHintReturn subclass and your own styles.
3696
3697 \sa StyleOptionVersion
3698*/
3699
3700/*!
3701 \enum QStyleHintReturn::StyleOptionVersion
3702
3703 This enum is used to hold information about the version of the style option, and
3704 is defined for each QStyleHintReturn subclass.
3705
3706 \value Version 1
3707
3708 The version is used by QStyleHintReturn subclasses to implement
3709 extensions without breaking compatibility. If you use
3710 qstyleoption_cast(), you normally do not need to check it.
3711
3712 \sa StyleOptionType
3713*/
3714
3715/*!
3716 \variable QStyleHintReturn::type
3717 \brief the type of the style hint container
3718
3719 \sa HintReturnType
3720*/
3721
3722/*!
3723 \variable QStyleHintReturn::version
3724 \brief the version of the style hint return container
3725
3726 This value can be used by subclasses to implement extensions
3727 without breaking compatibility. If you use qstyleoption_cast<T>(), you
3728 normally do not need to check it.
3729*/
3730
3731/*!
3732 Constructs a QStyleHintReturn with version \a version and type \a
3733 type.
3734
3735 The version has no special meaning for QStyleHintReturn; it can be
3736 used by subclasses to distinguish between different version of
3737 the same hint type.
3738
3739 \sa QStyleOption::version, QStyleOption::type
3740*/
3741
3742QStyleHintReturn::QStyleHintReturn(int version, int type)
3743 : version(version), type(type)
3744{
3745}
3746
3747/*!
3748 \internal
3749*/
3750
3751QStyleHintReturn::~QStyleHintReturn()
3752{
3753
3754}
3755
3756/*!
3757 \class QStyleHintReturnMask
3758 \brief The QStyleHintReturnMask class provides style hints that return a QRegion.
3759
3760 \ingroup appearance
3761 \inmodule QtWidgets
3762*/
3763
3764/*!
3765 \variable QStyleHintReturnMask::region
3766 \brief the region for style hints that return a QRegion
3767*/
3768
3769/*!
3770 Constructs a QStyleHintReturnMask. The member variables are
3771 initialized to default values.
3772*/
3773QStyleHintReturnMask::QStyleHintReturnMask() : QStyleHintReturn(Version, Type)
3774{
3775}
3776
3777/*!
3778 Destructor.
3779*/
3780QStyleHintReturnMask::~QStyleHintReturnMask()
3781{
3782}
3783
3784/*!
3785 \enum QStyleHintReturnMask::StyleOptionType
3786
3787 This enum is used to hold information about the type of the style option, and
3788 is defined for each QStyleHintReturn subclass.
3789
3790 \value Type The type of style option provided (\l{SH_Mask} for
3791 this class).
3792
3793 The type is used internally by QStyleHintReturn, its subclasses, and
3794 qstyleoption_cast() to determine the type of style option. In
3795 general you do not need to worry about this unless you want to
3796 create your own QStyleHintReturn subclass and your own styles.
3797
3798 \sa StyleOptionVersion
3799*/
3800
3801/*!
3802 \enum QStyleHintReturnMask::StyleOptionVersion
3803
3804 This enum is used to hold information about the version of the style option, and
3805 is defined for each QStyleHintReturn subclass.
3806
3807 \value Version 1
3808
3809 The version is used by QStyleHintReturn subclasses to implement
3810 extensions without breaking compatibility. If you use
3811 qstyleoption_cast(), you normally do not need to check it.
3812
3813 \sa StyleOptionType
3814*/
3815
3816/*!
3817 \class QStyleHintReturnVariant
3818 \brief The QStyleHintReturnVariant class provides style hints that return a QVariant.
3819 \since 4.3
3820 \ingroup appearance
3821 \inmodule QtWidgets
3822*/
3823
3824/*!
3825 \variable QStyleHintReturnVariant::variant
3826 \brief the variant for style hints that return a QVariant
3827*/
3828
3829/*!
3830 Constructs a QStyleHintReturnVariant. The member variables are
3831 initialized to default values.
3832*/
3833QStyleHintReturnVariant::QStyleHintReturnVariant() : QStyleHintReturn(Version, Type)
3834{
3835}
3836
3837/*!
3838 Destructor.
3839*/
3840QStyleHintReturnVariant::~QStyleHintReturnVariant()
3841{
3842}
3843
3844/*!
3845 \enum QStyleHintReturnVariant::StyleOptionType
3846
3847 This enum is used to hold information about the type of the style option, and
3848 is defined for each QStyleHintReturn subclass.
3849
3850 \value Type The type of style option provided (\l{SH_Variant} for
3851 this class).
3852
3853 The type is used internally by QStyleHintReturn, its subclasses, and
3854 qstyleoption_cast() to determine the type of style option. In
3855 general you do not need to worry about this unless you want to
3856 create your own QStyleHintReturn subclass and your own styles.
3857
3858 \sa StyleOptionVersion
3859*/
3860
3861/*!
3862 \enum QStyleHintReturnVariant::StyleOptionVersion
3863
3864 This enum is used to hold information about the version of the style option, and
3865 is defined for each QStyleHintReturn subclass.
3866
3867 \value Version 1
3868
3869 The version is used by QStyleHintReturn subclasses to implement
3870 extensions without breaking compatibility. If you use
3871 qstyleoption_cast(), you normally do not need to check it.
3872
3873 \sa StyleOptionType
3874*/
3875
3876/*!
3877 \fn template <typename T> T qstyleoption_cast<T>(const QStyleHintReturn *hint)
3878 \relates QStyleHintReturn
3879
3880 Returns a T or \nullptr depending on the \l{QStyleHintReturn::type}{type}
3881 and \l{QStyleHintReturn::version}{version} of \a hint.
3882
3883 Example:
3884
3885 \snippet code/src_gui_styles_qstyleoption.cpp 0
3886
3887 \sa QStyleHintReturn::type, QStyleHintReturn::version
3888*/
3889
3890/*!
3891 \fn template <typename T> T qstyleoption_cast<T>(QStyleHintReturn *hint)
3892 \overload
3893 \relates QStyleHintReturn
3894
3895 Returns a T or \nullptr depending on the type of \a hint.
3896*/
3897
3898#if !defined(QT_NO_DEBUG_STREAM)
3899QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType)
3900{
3901#if !defined(QT_NO_DEBUG)
3902 switch (optionType) {
3903 case QStyleOption::SO_Default:
3904 debug << "SO_Default"; break;
3905 case QStyleOption::SO_FocusRect:
3906 debug << "SO_FocusRect"; break;
3907 case QStyleOption::SO_Button:
3908 debug << "SO_Button"; break;
3909 case QStyleOption::SO_Tab:
3910 debug << "SO_Tab"; break;
3911 case QStyleOption::SO_MenuItem:
3912 debug << "SO_MenuItem"; break;
3913 case QStyleOption::SO_Frame:
3914 debug << "SO_Frame"; break;
3915 case QStyleOption::SO_ProgressBar:
3916 debug << "SO_ProgressBar"; break;
3917 case QStyleOption::SO_ToolBox:
3918 debug << "SO_ToolBox"; break;
3919 case QStyleOption::SO_Header:
3920 debug << "SO_Header"; break;
3921 case QStyleOption::SO_DockWidget:
3922 debug << "SO_DockWidget"; break;
3923 case QStyleOption::SO_ViewItem:
3924 debug << "SO_ViewItem"; break;
3925 case QStyleOption::SO_TabWidgetFrame:
3926 debug << "SO_TabWidgetFrame"; break;
3927 case QStyleOption::SO_TabBarBase:
3928 debug << "SO_TabBarBase"; break;
3929 case QStyleOption::SO_RubberBand:
3930 debug << "SO_RubberBand"; break;
3931 case QStyleOption::SO_Complex:
3932 debug << "SO_Complex"; break;
3933 case QStyleOption::SO_Slider:
3934 debug << "SO_Slider"; break;
3935 case QStyleOption::SO_SpinBox:
3936 debug << "SO_SpinBox"; break;
3937 case QStyleOption::SO_ToolButton:
3938 debug << "SO_ToolButton"; break;
3939 case QStyleOption::SO_ComboBox:
3940 debug << "SO_ComboBox"; break;
3941 case QStyleOption::SO_TitleBar:
3942 debug << "SO_TitleBar"; break;
3943 case QStyleOption::SO_CustomBase:
3944 debug << "SO_CustomBase"; break;
3945 case QStyleOption::SO_GroupBox:
3946 debug << "SO_GroupBox"; break;
3947 case QStyleOption::SO_ToolBar:
3948 debug << "SO_ToolBar"; break;
3949 case QStyleOption::SO_ComplexCustomBase:
3950 debug << "SO_ComplexCustomBase"; break;
3951 case QStyleOption::SO_SizeGrip:
3952 debug << "SO_SizeGrip"; break;
3953 case QStyleOption::SO_GraphicsItem:
3954 debug << "SO_GraphicsItem"; break;
3955 }
3956#else
3957 Q_UNUSED(optionType);
3958#endif
3959 return debug;
3960}
3961
3962QDebug operator<<(QDebug debug, const QStyleOption &option)
3963{
3964#if !defined(QT_NO_DEBUG)
3965 debug << "QStyleOption(";
3966 debug << QStyleOption::OptionType(option.type);
3967 debug << ',' << (option.direction == Qt::RightToLeft ? "RightToLeft" : "LeftToRight");
3968 debug << ',' << option.state;
3969 debug << ',' << option.rect;
3970 debug << ',' << option.styleObject;
3971 debug << ')';
3972#else
3973 Q_UNUSED(option);
3974#endif
3975 return debug;
3976}
3977#endif
3978
3979QT_END_NAMESPACE