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