1 /****************************************************************************
2 **
3 ** DQt - D bindings for the Qt Toolkit
4 **
5 ** GNU Lesser General Public License Usage
6 ** This file may be used under the terms of the GNU Lesser
7 ** General Public License version 3 as published by the Free Software
8 ** Foundation and appearing in the file LICENSE.LGPL3 included in the
9 ** packaging of this file. Please review the following information to
10 ** ensure the GNU Lesser General Public License version 3 requirements
11 ** will be met: https://www.gnu.org/licenses/lgpl-3.0.html.
12 **
13 ****************************************************************************/
14 module qt.widgets.styleoption;
15 extern(C++):
16 
17 import qt.config;
18 import qt.core.abstractitemmodel;
19 import qt.core.flags;
20 import qt.core.global;
21 import qt.core.locale;
22 import qt.core.namespace;
23 import qt.core.object;
24 import qt.core.point;
25 import qt.core.rect;
26 import qt.core.size;
27 import qt.core.string;
28 import qt.core.variant;
29 import qt.gui.brush;
30 import qt.gui.color;
31 import qt.gui.font;
32 import qt.gui.fontmetrics;
33 import qt.gui.icon;
34 import qt.gui.matrix;
35 import qt.gui.palette;
36 import qt.gui.region;
37 import qt.gui.transform;
38 import qt.helpers;
39 import qt.widgets.abstractspinbox;
40 import qt.widgets.frame;
41 import qt.widgets.rubberband;
42 import qt.widgets.slider;
43 import qt.widgets.style;
44 import qt.widgets.tabbar;
45 import qt.widgets.widget;
46 
47 /+ #if QT_CONFIG(spinbox)
48 #endif
49 #if QT_CONFIG(slider)
50 #endif
51 #if QT_CONFIG(tabbar)
52 #endif
53 #if QT_CONFIG(tabwidget)
54 #endif
55 #if QT_CONFIG(rubberband)
56 #endif
57 #if QT_CONFIG(itemviews)
58 #endif
59 
60 
61 
62 class QDebug; +/
63 
64 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOption
65 {
66 public:
67     enum OptionType {
68                       SO_Default, SO_FocusRect, SO_Button, SO_Tab, SO_MenuItem,
69                       SO_Frame, SO_ProgressBar, SO_ToolBox, SO_Header,
70                       SO_DockWidget, SO_ViewItem, SO_TabWidgetFrame,
71                       SO_TabBarBase, SO_RubberBand, SO_ToolBar, SO_GraphicsItem,
72 
73                       SO_Complex = 0xf0000, SO_Slider, SO_SpinBox, SO_ToolButton, SO_ComboBox,
74                       SO_TitleBar, SO_GroupBox, SO_SizeGrip,
75 
76                       SO_CustomBase = 0xf00,
77                       SO_ComplexCustomBase = 0xf000000
78                     }
79 
80     enum StyleOptionType { Type = OptionType.SO_Default }
81     enum StyleOptionVersion { Version = 1 }
82 
83     int version_;
84     int type;
85     QStyle.State state;
86     /+ Qt:: +/qt.core.namespace.LayoutDirection direction;
87     QRect rect;
88     QFontMetrics fontMetrics;
89     QPalette palette;
90     QObject styleObject;
91 
92     @disable this();
93     this(int version_/+ = QStyleOption.StyleOptionVersion.Version+/, int type = OptionType.SO_Default);
94     @disable this(this);
95     this(ref const(QStyleOption) other);
96     ~this();
97 
98     //void init_(const(QWidget) w);
99     // pragma(inline, true) void initFrom(const(QWidget) w) { init_(w); }
100     /+ref QStyleOption operator =(ref const(QStyleOption) other);+/
101 }
102 
103 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionFocusRect
104 {
105     public QStyleOption base0;
106     alias base0 this;
107     alias OptionType = QStyleOption.OptionType;
108 public:
109     enum StyleOptionType { Type = OptionType.SO_FocusRect }
110     enum StyleOptionVersion { Version = 1 }
111 
112     QColor backgroundColor;
113 
114     @disable this();
115     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
116     ref typeof(this) rawConstructor();
117     static typeof(this) create()
118     {
119         typeof(this) r = typeof(this).init;
120         r.rawConstructor();
121         return r;
122     }
123 
124     @disable this(this);
125     this(ref const(QStyleOptionFocusRect) other)
126     {
127         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
128         this = other;
129     }
130     /+ QStyleOptionFocusRect &operator=(const QStyleOptionFocusRect &) = default; +/
131 
132 protected:
133     this(int version_);
134 }
135 
136 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionFrame
137 {
138     public QStyleOption base0;
139     alias base0 this;
140     alias OptionType = QStyleOption.OptionType;
141 public:
142     enum StyleOptionType { Type = OptionType.SO_Frame }
143     enum StyleOptionVersion { Version = 3 }
144 
145     int lineWidth;
146     int midLineWidth;
147     enum FrameFeature {
148         None = 0x00,
149         Flat = 0x01,
150         Rounded = 0x02
151     }
152     /+ Q_DECLARE_FLAGS(FrameFeatures, FrameFeature) +/
153 alias FrameFeatures = QFlags!(FrameFeature);    FrameFeatures features;
154     QFrame.Shape frameShape;
155 
156     @disable this();
157     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
158     ref typeof(this) rawConstructor();
159     static typeof(this) create()
160     {
161         typeof(this) r = typeof(this).init;
162         r.rawConstructor();
163         return r;
164     }
165 
166     @disable this(this);
167     this(ref const(QStyleOptionFrame) other)
168     {
169         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
170         this = other;
171     }
172     /+ QStyleOptionFrame &operator=(const QStyleOptionFrame &) = default; +/
173 
174 protected:
175     this(int version_);
176 }
177 /+pragma(inline, true) QFlags!(QStyleOptionFrame.FrameFeatures.enum_type) operator |(QStyleOptionFrame.FrameFeatures.enum_type f1, QStyleOptionFrame.FrameFeatures.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionFrame.FrameFeatures.enum_type)(f1)|f2;}+/
178 /+pragma(inline, true) QFlags!(QStyleOptionFrame.FrameFeatures.enum_type) operator |(QStyleOptionFrame.FrameFeatures.enum_type f1, QFlags!(QStyleOptionFrame.FrameFeatures.enum_type) f2)/+noexcept+/{return f2|f1;}+/
179 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionFrame.FrameFeatures.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
180 
181 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionFrame::FrameFeatures) +/
182 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionFrameV2 = QStyleOptionFrame;
183 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionFrameV3 = QStyleOptionFrame;
184 
185 /+ #if QT_CONFIG(tabwidget) +/
186 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionTabWidgetFrame
187 {
188     public QStyleOption base0;
189     alias base0 this;
190     alias OptionType = QStyleOption.OptionType;
191 public:
192     enum StyleOptionType { Type = OptionType.SO_TabWidgetFrame }
193     enum StyleOptionVersion { Version = 2 }
194 
195     int lineWidth;
196     int midLineWidth;
197     QTabBar.Shape shape;
198     QSize tabBarSize;
199     QSize rightCornerWidgetSize;
200     QSize leftCornerWidgetSize;
201     QRect tabBarRect;
202     QRect selectedTabRect;
203 
204     @disable this();
205     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
206     ref typeof(this) rawConstructor();
207     static typeof(this) create()
208     {
209         typeof(this) r = typeof(this).init;
210         r.rawConstructor();
211         return r;
212     }
213 
214     @disable this(this);
215     pragma(inline, true) this(ref const(QStyleOptionTabWidgetFrame) other)
216     {
217         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
218         this = other;
219     }
220     /+ QStyleOptionTabWidgetFrame &operator=(const QStyleOptionTabWidgetFrame &) = default; +/
221 
222 protected:
223     this(int version_);
224 }
225 
226 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionTabWidgetFrameV2 = QStyleOptionTabWidgetFrame;
227 /+ #endif // QT_CONFIG(tabwidget)
228 
229 
230 #if QT_CONFIG(tabbar) +/
231 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionTabBarBase
232 {
233     public QStyleOption base0;
234     alias base0 this;
235     alias OptionType = QStyleOption.OptionType;
236 public:
237     enum StyleOptionType { Type = OptionType.SO_TabBarBase }
238     enum StyleOptionVersion { Version = 2 }
239 
240     QTabBar.Shape shape;
241     QRect tabBarRect;
242     QRect selectedTabRect;
243     bool documentMode;
244 
245     @disable this();
246     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
247     ref typeof(this) rawConstructor();
248     static typeof(this) create()
249     {
250         typeof(this) r = typeof(this).init;
251         r.rawConstructor();
252         return r;
253     }
254 
255     @disable this(this);
256     this(ref const(QStyleOptionTabBarBase) other)
257     {
258         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
259         this = other;
260     }
261     /+ QStyleOptionTabBarBase &operator=(const QStyleOptionTabBarBase &) = default; +/
262 
263 protected:
264     this(int version_);
265 }
266 
267 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionTabBarBaseV2 = QStyleOptionTabBarBase;
268 /+ #endif +/ // QT_CONFIG(tabbar)
269 
270 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionHeader
271 {
272     public QStyleOption base0;
273     alias base0 this;
274     alias OptionType = QStyleOption.OptionType;
275 public:
276     enum StyleOptionType { Type = OptionType.SO_Header }
277     enum StyleOptionVersion { Version = 1 }
278 
279     enum SectionPosition { Beginning, Middle, End, OnlyOneSection }
280     enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected,
281                             NextAndPreviousAreSelected }
282     enum SortIndicator { None, SortUp, SortDown }
283 
284     int section;
285     QString text;
286     /+ Qt:: +/qt.core.namespace.Alignment textAlignment;
287     QIcon icon;
288     /+ Qt:: +/qt.core.namespace.Alignment iconAlignment;
289     SectionPosition position;
290     SelectedPosition selectedPosition;
291     SortIndicator sortIndicator;
292     /+ Qt:: +/qt.core.namespace.Orientation orientation;
293 
294     @disable this();
295     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
296     ref typeof(this) rawConstructor();
297     static typeof(this) create()
298     {
299         typeof(this) r = typeof(this).init;
300         r.rawConstructor();
301         return r;
302     }
303 
304     @disable this(this);
305     this(ref const(QStyleOptionHeader) other)
306     {
307         text = QString.create;
308         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
309         this = other;
310     }
311     /+ QStyleOptionHeader &operator=(const QStyleOptionHeader &) = default; +/
312 
313 protected:
314     this(int version_);
315 }
316 
317 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionButton
318 {
319     public QStyleOption base0;
320     alias base0 this;
321     alias OptionType = QStyleOption.OptionType;
322 public:
323     enum StyleOptionType { Type = OptionType.SO_Button }
324     enum StyleOptionVersion { Version = 1 }
325 
326     enum ButtonFeature { None = 0x00, Flat = 0x01, HasMenu = 0x02, DefaultButton = 0x04,
327                          AutoDefaultButton = 0x08, CommandLinkButton = 0x10  }
328     /+ Q_DECLARE_FLAGS(ButtonFeatures, ButtonFeature) +/
329 alias ButtonFeatures = QFlags!(ButtonFeature);
330     ButtonFeatures features;
331     QString text;
332     QIcon icon;
333     QSize iconSize;
334 
335     @disable this();
336     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
337     ref typeof(this) rawConstructor();
338     static typeof(this) create()
339     {
340         typeof(this) r = typeof(this).init;
341         r.rawConstructor();
342         return r;
343     }
344 
345     @disable this(this);
346     this(ref const(QStyleOptionButton) other)
347     {
348         text = QString.create;
349         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
350         this = other;
351     }
352     /+ QStyleOptionButton &operator=(const QStyleOptionButton &) = default; +/
353 
354 protected:
355     this(int version_);
356 }
357 /+pragma(inline, true) QFlags!(QStyleOptionButton.ButtonFeatures.enum_type) operator |(QStyleOptionButton.ButtonFeatures.enum_type f1, QStyleOptionButton.ButtonFeatures.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionButton.ButtonFeatures.enum_type)(f1)|f2;}+/
358 /+pragma(inline, true) QFlags!(QStyleOptionButton.ButtonFeatures.enum_type) operator |(QStyleOptionButton.ButtonFeatures.enum_type f1, QFlags!(QStyleOptionButton.ButtonFeatures.enum_type) f2)/+noexcept+/{return f2|f1;}+/
359 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionButton.ButtonFeatures.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
360 
361 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionButton::ButtonFeatures)
362 #if QT_CONFIG(tabbar) +/
363 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionTab
364 {
365     public QStyleOption base0;
366     alias base0 this;
367     alias OptionType = QStyleOption.OptionType;
368 public:
369     enum StyleOptionType { Type = OptionType.SO_Tab }
370     enum StyleOptionVersion { Version = 3 }
371 
372     enum TabPosition { Beginning, Middle, End, OnlyOneTab }
373     enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected }
374     enum CornerWidget { NoCornerWidgets = 0x00, LeftCornerWidget = 0x01,
375                         RightCornerWidget = 0x02 }
376     enum TabFeature { None = 0x00, HasFrame = 0x01 }
377     /+ Q_DECLARE_FLAGS(CornerWidgets, CornerWidget) +/
378 alias CornerWidgets = QFlags!(CornerWidget);    /+ Q_DECLARE_FLAGS(TabFeatures, TabFeature) +/
379 alias TabFeatures = QFlags!(TabFeature);
380     QTabBar.Shape shape;
381     QString text;
382     QIcon icon;
383     int row;
384     TabPosition position;
385     SelectedPosition selectedPosition;
386     CornerWidgets cornerWidgets;
387     QSize iconSize;
388     bool documentMode;
389     QSize leftButtonSize;
390     QSize rightButtonSize;
391     TabFeatures features;
392 
393     @disable this();
394     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
395     ref typeof(this) rawConstructor();
396     static typeof(this) create()
397     {
398         typeof(this) r = typeof(this).init;
399         r.rawConstructor();
400         return r;
401     }
402 
403     @disable this(this);
404     this(ref const(QStyleOptionTab) other)
405     {
406         text = QString.create(); 
407         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
408         this = other;
409     }
410     /+ QStyleOptionTab &operator=(const QStyleOptionTab &) = default; +/
411 
412 protected:
413     this(int version_);
414 }
415 
416 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionTabV4
417 {
418     public QStyleOptionTab base0;
419     alias base0 this;
420     alias OptionType = QStyleOption.OptionType;
421 public:
422     enum StyleOptionVersion { Version = 4 }
423     @disable this();
424     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
425     ref typeof(this) rawConstructor();
426     static typeof(this) create()
427     {
428         typeof(this) r = typeof(this).init;
429         r.rawConstructor();
430         return r;
431     }
432 
433     int tabIndex = -1;
434 }
435 /+pragma(inline, true) QFlags!(QStyleOptionTab.CornerWidgets.enum_type) operator |(QStyleOptionTab.CornerWidgets.enum_type f1, QStyleOptionTab.CornerWidgets.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionTab.CornerWidgets.enum_type)(f1)|f2;}+/
436 /+pragma(inline, true) QFlags!(QStyleOptionTab.CornerWidgets.enum_type) operator |(QStyleOptionTab.CornerWidgets.enum_type f1, QFlags!(QStyleOptionTab.CornerWidgets.enum_type) f2)/+noexcept+/{return f2|f1;}+/
437 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionTab.CornerWidgets.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
438 
439 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionTab::CornerWidgets) +/
440 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionTabV2 = QStyleOptionTab;
441 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionTabV3 = QStyleOptionTab;
442 /+ #endif // QT_CONFIG(tabbar)
443 
444 
445 #if QT_CONFIG(toolbar) +/
446 
447 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionToolBar
448 {
449     public QStyleOption base0;
450     alias base0 this;
451     alias OptionType = QStyleOption.OptionType;
452 public:
453     enum StyleOptionType { Type = OptionType.SO_ToolBar }
454     enum StyleOptionVersion { Version = 1 }
455     enum ToolBarPosition { Beginning, Middle, End, OnlyOne }
456     enum ToolBarFeature { None = 0x0, Movable = 0x1 }
457     /+ Q_DECLARE_FLAGS(ToolBarFeatures, ToolBarFeature) +/
458 alias ToolBarFeatures = QFlags!(ToolBarFeature);    ToolBarPosition positionOfLine; // The toolbar line position
459     ToolBarPosition positionWithinLine; // The position within a toolbar
460     /+ Qt:: +/qt.core.namespace.ToolBarArea toolBarArea; // The toolbar docking area
461     ToolBarFeatures features;
462     int lineWidth;
463     int midLineWidth;
464     @disable this();
465     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
466     ref typeof(this) rawConstructor();
467     static typeof(this) create()
468     {
469         typeof(this) r = typeof(this).init;
470         r.rawConstructor();
471         return r;
472     }
473 
474     @disable this(this);
475     this(ref const(QStyleOptionToolBar) other)
476     {
477         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
478         this = other;
479     }
480     /+ QStyleOptionToolBar &operator=(const QStyleOptionToolBar &) = default; +/
481 
482 protected:
483     this(int version_);
484 }
485 /+pragma(inline, true) QFlags!(QStyleOptionToolBar.ToolBarFeatures.enum_type) operator |(QStyleOptionToolBar.ToolBarFeatures.enum_type f1, QStyleOptionToolBar.ToolBarFeatures.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionToolBar.ToolBarFeatures.enum_type)(f1)|f2;}+/
486 /+pragma(inline, true) QFlags!(QStyleOptionToolBar.ToolBarFeatures.enum_type) operator |(QStyleOptionToolBar.ToolBarFeatures.enum_type f1, QFlags!(QStyleOptionToolBar.ToolBarFeatures.enum_type) f2)/+noexcept+/{return f2|f1;}+/
487 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionToolBar.ToolBarFeatures.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
488 
489 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionToolBar::ToolBarFeatures) +/
490 /+ #endif +/ // QT_CONFIG(toolbar)
491 
492 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionProgressBar
493 {
494     public QStyleOption base0;
495     alias base0 this;
496     alias OptionType = QStyleOption.OptionType;
497 public:
498     enum StyleOptionType { Type = OptionType.SO_ProgressBar }
499     enum StyleOptionVersion { Version = 2 }
500 
501     int minimum;
502     int maximum;
503     int progress;
504     QString text;
505     /+ Qt:: +/qt.core.namespace.Alignment textAlignment;
506     bool textVisible;
507     /+ Qt:: +/qt.core.namespace.Orientation orientation; // ### Qt 6: remove
508     bool invertedAppearance;
509     bool bottomToTop;
510 
511     @disable this();
512     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
513     ref typeof(this) rawConstructor();
514     static typeof(this) create()
515     {
516         typeof(this) r = typeof(this).init;
517         r.rawConstructor();
518         return r;
519     }
520 
521     @disable this(this);
522     this(ref const(QStyleOptionProgressBar) other)
523     {
524         text = QString.create();
525         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
526         this = other;
527     }
528     /+ QStyleOptionProgressBar &operator=(const QStyleOptionProgressBar &) = default; +/
529 
530 protected:
531     this(int version_);
532 }
533 
534 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionProgressBarV2 = QStyleOptionProgressBar;
535 
536 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionMenuItem
537 {
538     public QStyleOption base0;
539     alias base0 this;
540     alias OptionType = QStyleOption.OptionType;
541 public:
542     enum StyleOptionType { Type = OptionType.SO_MenuItem }
543     enum StyleOptionVersion { Version = 1 }
544 
545     enum MenuItemType { Normal, DefaultItem, Separator, SubMenu, Scroller, TearOff, Margin,
546                         EmptyArea }
547     enum CheckType { NotCheckable, Exclusive, NonExclusive }
548 
549     MenuItemType menuItemType;
550     CheckType checkType;
551     bool checked;
552     bool menuHasCheckableItems;
553     QRect menuRect;
554     QString text;
555     QIcon icon;
556     int maxIconWidth;
557     int tabWidth; // ### Qt 6: rename to reservedShortcutWidth
558     QFont font;
559 
560     @disable this();
561     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
562     ref typeof(this) rawConstructor();
563     static typeof(this) create()
564     {
565         typeof(this) r = typeof(this).init;
566         r.rawConstructor();
567         return r;
568     }
569 
570     @disable this(this);
571     this(ref const(QStyleOptionMenuItem) other)
572     {
573         text = QString.create;
574         font = QFont.create;
575         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
576         this = other;
577     }
578     /+ QStyleOptionMenuItem &operator=(const QStyleOptionMenuItem &) = default; +/
579 
580 protected:
581     this(int version_);
582 }
583 
584 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionDockWidget
585 {
586     public QStyleOption base0;
587     alias base0 this;
588     alias OptionType = QStyleOption.OptionType;
589 public:
590     enum StyleOptionType { Type = OptionType.SO_DockWidget }
591     enum StyleOptionVersion { Version = 2 }
592 
593     QString title;
594     bool closable;
595     bool movable;
596     bool floatable;
597     bool verticalTitleBar;
598 
599     @disable this();
600     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
601     ref typeof(this) rawConstructor();
602     static typeof(this) create()
603     {
604         typeof(this) r = typeof(this).init;
605         r.rawConstructor();
606         return r;
607     }
608 
609     @disable this(this);
610     this(ref const(QStyleOptionDockWidget) other)
611     {
612         title = QString.create();
613         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
614         this = other;
615     }
616     /+ QStyleOptionDockWidget &operator=(const QStyleOptionDockWidget &) = default; +/
617 
618 protected:
619     this(int version_);
620 }
621 
622 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionDockWidgetV2 = QStyleOptionDockWidget;
623 
624 /+ #if QT_CONFIG(itemviews) +/
625 
626 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionViewItem
627 {
628     public QStyleOption base0;
629     alias base0 this;
630     alias OptionType = QStyleOption.OptionType;
631 public:
632     enum StyleOptionType { Type = OptionType.SO_ViewItem }
633     enum StyleOptionVersion { Version = 4 }
634 
635     enum Position { Left, Right, Top, Bottom }
636 
637     /+ Qt:: +/qt.core.namespace.Alignment displayAlignment;
638     /+ Qt:: +/qt.core.namespace.Alignment decorationAlignment;
639     /+ Qt:: +/qt.core.namespace.TextElideMode textElideMode;
640     Position decorationPosition;
641     QSize decorationSize;
642     QFont font;
643     bool showDecorationSelected;
644 
645     enum ViewItemFeature {
646         None = 0x00,
647         WrapText = 0x01,
648         Alternate = 0x02,
649         HasCheckIndicator = 0x04,
650         HasDisplay = 0x08,
651         HasDecoration = 0x10
652     }
653     /+ Q_DECLARE_FLAGS(ViewItemFeatures, ViewItemFeature) +/
654 alias ViewItemFeatures = QFlags!(ViewItemFeature);
655     ViewItemFeatures features;
656 
657     QLocale locale;
658     /*const*/ QWidget widget;
659 
660     enum ViewItemPosition { Invalid, Beginning, Middle, End, OnlyOne }
661 
662     QModelIndex index;
663     /+ Qt:: +/qt.core.namespace.CheckState checkState;
664     QIcon icon;
665     QString text;
666     ViewItemPosition viewItemPosition;
667     QBrush backgroundBrush;
668 
669     @disable this();
670     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
671     ref typeof(this) rawConstructor();
672     static typeof(this) create()
673     {
674         typeof(this) r = typeof(this).init;
675         r.rawConstructor();
676         return r;
677     }
678 
679     @disable this(this);
680     this(ref const(QStyleOptionViewItem) other)
681     {
682         font = QFont.create;
683         text = QString.create;
684         locale = QLocale.create;
685         backgroundBrush = QBrush.create;
686         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
687         this = other;
688     }
689     /+ QStyleOptionViewItem &operator=(const QStyleOptionViewItem &) = default; +/
690 
691 protected:
692     this(int version_);
693 }
694 /+pragma(inline, true) QFlags!(QStyleOptionViewItem.ViewItemFeatures.enum_type) operator |(QStyleOptionViewItem.ViewItemFeatures.enum_type f1, QStyleOptionViewItem.ViewItemFeatures.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionViewItem.ViewItemFeatures.enum_type)(f1)|f2;}+/
695 /+pragma(inline, true) QFlags!(QStyleOptionViewItem.ViewItemFeatures.enum_type) operator |(QStyleOptionViewItem.ViewItemFeatures.enum_type f1, QFlags!(QStyleOptionViewItem.ViewItemFeatures.enum_type) f2)/+noexcept+/{return f2|f1;}+/
696 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionViewItem.ViewItemFeatures.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
697 
698 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionViewItem::ViewItemFeatures) +/
699 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionViewItemV2 = QStyleOptionViewItem;
700 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionViewItemV3 = QStyleOptionViewItem;
701 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionViewItemV4 = QStyleOptionViewItem;
702 
703 /+ #endif +/ // QT_CONFIG(itemviews)
704 
705 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionToolBox
706 {
707     public QStyleOption base0;
708     alias base0 this;
709     alias OptionType = QStyleOption.OptionType;
710 public:
711     enum StyleOptionType { Type = OptionType.SO_ToolBox }
712     enum StyleOptionVersion { Version = 2 }
713 
714     QString text;
715     QIcon icon;
716 
717     enum TabPosition { Beginning, Middle, End, OnlyOneTab }
718     enum SelectedPosition { NotAdjacent, NextIsSelected, PreviousIsSelected }
719 
720     TabPosition position;
721     SelectedPosition selectedPosition;
722 
723     @disable this();
724     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
725     ref typeof(this) rawConstructor();
726     static typeof(this) create()
727     {
728         typeof(this) r = typeof(this).init;
729         r.rawConstructor();
730         return r;
731     }
732 
733     @disable this(this);
734     this(ref const(QStyleOptionToolBox) other)
735     {
736         text = QString.create;
737         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
738         this = other;
739     }
740     /+ QStyleOptionToolBox &operator=(const QStyleOptionToolBox &) = default; +/
741 
742 protected:
743     this(int version_);
744 }
745 
746 /+ Q_DECL_DEPRECATED +/ alias QStyleOptionToolBoxV2 = QStyleOptionToolBox;
747 
748 /+ #if QT_CONFIG(rubberband) +/
749 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionRubberBand
750 {
751     public QStyleOption base0;
752     alias base0 this;
753     alias OptionType = QStyleOption.OptionType;
754 public:
755     enum StyleOptionType { Type = OptionType.SO_RubberBand }
756     enum StyleOptionVersion { Version = 1 }
757 
758     QRubberBand.Shape shape;
759     bool opaque;
760 
761     @disable this();
762     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
763     ref typeof(this) rawConstructor();
764     static typeof(this) create()
765     {
766         typeof(this) r = typeof(this).init;
767         r.rawConstructor();
768         return r;
769     }
770 
771     @disable this(this);
772     this(ref const(QStyleOptionRubberBand) other)
773     {
774         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
775         this = other;
776     }
777     /+ QStyleOptionRubberBand &operator=(const QStyleOptionRubberBand &) = default; +/
778 
779 protected:
780     this(int version_);
781 }
782 /+ #endif +/ // QT_CONFIG(rubberband)
783 
784 // -------------------------- Complex style options -------------------------------
785 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionComplex
786 {
787     public QStyleOption base0;
788     alias base0 this;
789     alias OptionType = QStyleOption.OptionType;
790 public:
791     enum StyleOptionType { Type = OptionType.SO_Complex }
792     enum StyleOptionVersion { Version = 1 }
793 
794     QStyle.SubControls subControls;
795     QStyle.SubControls activeSubControls;
796 
797     @disable this();
798     this(int version_/+ = QStyleOptionComplex.StyleOptionVersion.Version+/, int type = OptionType.SO_Complex);
799     @disable this(this);
800     this(ref const(QStyleOptionComplex) other)
801     {
802         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
803         this = other;
804     }
805     /+ QStyleOptionComplex &operator=(const QStyleOptionComplex &) = default; +/
806 }
807 
808 /+ #if QT_CONFIG(slider) +/
809 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionSlider
810 {
811     public QStyleOptionComplex base0;
812     alias base0 this;
813     alias OptionType = QStyleOption.OptionType;
814 public:
815     enum StyleOptionType { Type = OptionType.SO_Slider }
816     enum StyleOptionVersion { Version = 1 }
817 
818     /+ Qt:: +/qt.core.namespace.Orientation orientation;
819     int minimum;
820     int maximum;
821     QSlider.TickPosition tickPosition;
822     int tickInterval;
823     bool upsideDown;
824     int sliderPosition;
825     int sliderValue;
826     int singleStep;
827     int pageStep;
828     qreal notchTarget;
829     bool dialWrapping;
830 
831     @disable this();
832     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
833     ref typeof(this) rawConstructor();
834     static typeof(this) create()
835     {
836         typeof(this) r = typeof(this).init;
837         r.rawConstructor();
838         return r;
839     }
840 
841     @disable this(this);
842     this(ref const(QStyleOptionSlider) other)
843     {
844         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
845         this = other;
846     }
847     /+ QStyleOptionSlider &operator=(const QStyleOptionSlider &) = default; +/
848 
849 protected:
850     this(int version_);
851 }
852 /+ #endif // QT_CONFIG(slider)
853 
854 #if QT_CONFIG(spinbox) +/
855 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionSpinBox
856 {
857     public QStyleOptionComplex base0;
858     alias base0 this;
859     alias OptionType = QStyleOption.OptionType;
860 public:
861     enum StyleOptionType { Type = OptionType.SO_SpinBox }
862     enum StyleOptionVersion { Version = 1 }
863 
864     QAbstractSpinBox.ButtonSymbols buttonSymbols;
865     QAbstractSpinBox.StepEnabled stepEnabled;
866     bool frame;
867 
868     @disable this();
869     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
870     ref typeof(this) rawConstructor();
871     static typeof(this) create()
872     {
873         typeof(this) r = typeof(this).init;
874         r.rawConstructor();
875         return r;
876     }
877 
878     @disable this(this);
879     this(ref const(QStyleOptionSpinBox) other)
880     {
881         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
882         this = other;
883     }
884     /+ QStyleOptionSpinBox &operator=(const QStyleOptionSpinBox &) = default; +/
885 
886 protected:
887     this(int version_);
888 }
889 /+ #endif +/ // QT_CONFIG(spinbox)
890 
891 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionToolButton
892 {
893     public QStyleOptionComplex base0;
894     alias base0 this;
895     alias OptionType = QStyleOption.OptionType;
896 public:
897     enum StyleOptionType { Type = OptionType.SO_ToolButton }
898     enum StyleOptionVersion { Version = 1 }
899 
900     enum ToolButtonFeature { None = 0x00, Arrow = 0x01, Menu = 0x04, MenuButtonPopup = ToolButtonFeature.Menu, PopupDelay = 0x08,
901                              HasMenu = 0x10 }
902     /+ Q_DECLARE_FLAGS(ToolButtonFeatures, ToolButtonFeature) +/
903 alias ToolButtonFeatures = QFlags!(ToolButtonFeature);
904     ToolButtonFeatures features;
905     QIcon icon;
906     QSize iconSize;
907     QString text;
908     /+ Qt:: +/qt.core.namespace.ArrowType arrowType;
909     /+ Qt:: +/qt.core.namespace.ToolButtonStyle toolButtonStyle;
910     QPoint pos;
911     QFont font;
912 
913     @disable this();
914     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
915     ref typeof(this) rawConstructor();
916     static typeof(this) create()
917     {
918         typeof(this) r = typeof(this).init;
919         r.rawConstructor();
920         return r;
921     }
922 
923     @disable this(this);
924     this(ref const(QStyleOptionToolButton) other)
925     {
926         text = QString.create;
927         font = QFont.create;
928         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
929         this = other;
930     }
931     /+ QStyleOptionToolButton &operator=(const QStyleOptionToolButton &) = default; +/
932 
933 protected:
934     this(int version_);
935 }
936 /+pragma(inline, true) QFlags!(QStyleOptionToolButton.ToolButtonFeatures.enum_type) operator |(QStyleOptionToolButton.ToolButtonFeatures.enum_type f1, QStyleOptionToolButton.ToolButtonFeatures.enum_type f2)/+noexcept+/{return QFlags!(QStyleOptionToolButton.ToolButtonFeatures.enum_type)(f1)|f2;}+/
937 /+pragma(inline, true) QFlags!(QStyleOptionToolButton.ToolButtonFeatures.enum_type) operator |(QStyleOptionToolButton.ToolButtonFeatures.enum_type f1, QFlags!(QStyleOptionToolButton.ToolButtonFeatures.enum_type) f2)/+noexcept+/{return f2|f1;}+/
938 /+pragma(inline, true) QIncompatibleFlag operator |(QStyleOptionToolButton.ToolButtonFeatures.enum_type f1, int f2)/+noexcept+/{return QIncompatibleFlag(int(f1)|f2);}+/
939 
940 /+ Q_DECLARE_OPERATORS_FOR_FLAGS(QStyleOptionToolButton::ToolButtonFeatures) +/
941 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionComboBox
942 {
943     public QStyleOptionComplex base0;
944     alias base0 this;
945     alias OptionType = QStyleOption.OptionType;
946 public:
947     enum StyleOptionType { Type = OptionType.SO_ComboBox }
948     enum StyleOptionVersion { Version = 1 }
949 
950     bool editable;
951     QRect popupRect;
952     bool frame;
953     QString currentText;
954     QIcon currentIcon;
955     QSize iconSize;
956 
957     @disable this();
958     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
959     ref typeof(this) rawConstructor();
960     static typeof(this) create()
961     {
962         typeof(this) r = typeof(this).init;
963         r.rawConstructor();
964         return r;
965     }
966 
967     @disable this(this);
968     this(ref const(QStyleOptionComboBox) other)
969     {
970         currentText = QString.create;
971         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
972         this = other;
973     }
974     /+ QStyleOptionComboBox &operator=(const QStyleOptionComboBox &) = default; +/
975 
976 protected:
977     this(int version_);
978 }
979 
980 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionTitleBar
981 {
982     public QStyleOptionComplex base0;
983     alias base0 this;
984     alias OptionType = QStyleOption.OptionType;
985 public:
986     enum StyleOptionType { Type = OptionType.SO_TitleBar }
987     enum StyleOptionVersion { Version = 1 }
988 
989     QString text;
990     QIcon icon;
991     int titleBarState;
992     /+ Qt:: +/qt.core.namespace.WindowFlags titleBarFlags;
993 
994     @disable this();
995     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
996     ref typeof(this) rawConstructor();
997     static typeof(this) create()
998     {
999         typeof(this) r = typeof(this).init;
1000         r.rawConstructor();
1001         return r;
1002     }
1003 
1004     @disable this(this);
1005     this(ref const(QStyleOptionTitleBar) other)
1006     {
1007         text = QString.create;
1008         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
1009         this = other;
1010     }
1011     /+ QStyleOptionTitleBar &operator=(const QStyleOptionTitleBar &) = default; +/
1012 
1013 protected:
1014     this(int version_);
1015 }
1016 
1017 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionGroupBox
1018 {
1019     public QStyleOptionComplex base0;
1020     alias base0 this;
1021     alias OptionType = QStyleOption.OptionType;
1022 public:
1023     enum StyleOptionType { Type = OptionType.SO_GroupBox }
1024     enum StyleOptionVersion { Version = 1 }
1025 
1026     QStyleOptionFrame.FrameFeatures features;
1027     QString text;
1028     /+ Qt:: +/qt.core.namespace.Alignment textAlignment;
1029     QColor textColor;
1030     int lineWidth;
1031     int midLineWidth;
1032 
1033     @disable this();
1034     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
1035     ref typeof(this) rawConstructor();
1036     static typeof(this) create()
1037     {
1038         typeof(this) r = typeof(this).init;
1039         r.rawConstructor();
1040         return r;
1041     }
1042 
1043     @disable this(this);
1044     this(ref const(QStyleOptionGroupBox) other)
1045     {
1046         text = QString.create;
1047         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
1048         this = other;
1049     }
1050     /+ QStyleOptionGroupBox &operator=(const QStyleOptionGroupBox &) = default; +/
1051 protected:
1052     this(int version_);
1053 }
1054 
1055 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionSizeGrip
1056 {
1057     public QStyleOptionComplex base0;
1058     alias base0 this;
1059     alias OptionType = QStyleOption.OptionType;
1060 public:
1061     enum StyleOptionType { Type = OptionType.SO_SizeGrip }
1062     enum StyleOptionVersion { Version = 1 }
1063 
1064     /+ Qt:: +/qt.core.namespace.Corner corner;
1065 
1066     @disable this();
1067     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
1068     ref typeof(this) rawConstructor();
1069     static typeof(this) create()
1070     {
1071         typeof(this) r = typeof(this).init;
1072         r.rawConstructor();
1073         return r;
1074     }
1075 
1076     @disable this(this);
1077     this(ref const(QStyleOptionSizeGrip) other)
1078     {
1079         this.base0 = QStyleOptionComplex(StyleOptionVersion.Version, StyleOptionType.Type);
1080         this = other;
1081     }
1082     /+ QStyleOptionSizeGrip &operator=(const QStyleOptionSizeGrip &) = default; +/
1083 protected:
1084     this(int version_);
1085 }
1086 
1087 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleOptionGraphicsItem
1088 {
1089     public QStyleOption base0;
1090     alias base0 this;
1091     alias OptionType = QStyleOption.OptionType;
1092 public:
1093     enum StyleOptionType { Type = OptionType.SO_GraphicsItem }
1094     enum StyleOptionVersion { Version = 1 }
1095 
1096     QRectF exposedRect;
1097     QMatrix matrix;
1098     qreal levelOfDetail;
1099 
1100     @disable this();
1101     pragma(mangle, defaultConstructorMangling(__traits(identifier, typeof(this))))
1102     ref typeof(this) rawConstructor();
1103     static typeof(this) create()
1104     {
1105         typeof(this) r = typeof(this).init;
1106         r.rawConstructor();
1107         return r;
1108     }
1109 
1110     @disable this(this);
1111     this(ref const(QStyleOptionGraphicsItem) other)
1112     {
1113         this.base0 = QStyleOption(StyleOptionVersion.Version, StyleOptionType.Type);
1114         this = other;
1115     }
1116     /+ QStyleOptionGraphicsItem &operator=(const QStyleOptionGraphicsItem &) = default; +/
1117     static qreal levelOfDetailFromTransform(ref const(QTransform) worldTransform);
1118 protected:
1119     this(int version_);
1120 }
1121 
1122 T qstyleoption_cast(T)(const(QStyleOption)* opt)
1123 {
1124     /+ typename std::remove_cv<typename std::remove_pointer<T>::type>::type +/alias Opt = type;
1125     if (opt && opt.version_ >= Opt.Version && (opt.type == Opt.Type
1126         || int(Opt.Type) == QStyleOption.OptionType.SO_Default
1127         || (int(Opt.Type) == QStyleOption.OptionType.SO_Complex
1128             && opt.type > QStyleOption.OptionType.SO_Complex)))
1129         return static_cast!(T)(opt);
1130     return null;
1131 }
1132 
1133 T qstyleoption_cast(T)(QStyleOption* opt)
1134 {
1135     /+ typename std::remove_cv<typename std::remove_pointer<T>::type>::type +/alias Opt = type;
1136     if (opt && opt.version_ >= Opt.Version && (opt.type == Opt.Type
1137         || int(Opt.Type) == QStyleOption.OptionType.SO_Default
1138         || (int(Opt.Type) == QStyleOption.OptionType.SO_Complex
1139             && opt.type > QStyleOption.OptionType.SO_Complex)))
1140         return static_cast!(T)(opt);
1141     return null;
1142 }
1143 
1144 // -------------------------- QStyleHintReturn -------------------------------
1145 extern(C++, class) struct /+ Q_WIDGETS_EXPORT +/ QStyleHintReturn {
1146 public:
1147     enum HintReturnType {
1148         SH_Default=0xf000, SH_Mask, SH_Variant
1149     }
1150 
1151     enum StyleOptionType { Type = HintReturnType.SH_Default }
1152     enum StyleOptionVersion { Version = 1 }
1153 
1154     @disable this();
1155     this(int version_/+ = QStyleOption.StyleOptionVersion.Version+/, int type = HintReturnType.SH_Default);
1156     ~this();
1157 
1158     int version_;
1159     int type;
1160 }
1161 
1162 /+class /+ Q_WIDGETS_EXPORT +/ QStyleHintReturnMask : QStyleHintReturn {
1163 public:
1164     enum StyleOptionType { Type = HintReturnType.SH_Mask }
1165     enum StyleOptionVersion { Version = 1 }
1166 
1167     this();
1168     ~this();
1169 
1170     QRegion region;
1171 }
1172 
1173 class /+ Q_WIDGETS_EXPORT +/ QStyleHintReturnVariant : QStyleHintReturn {
1174 public:
1175     enum StyleOptionType { Type = HintReturnType.SH_Variant }
1176     enum StyleOptionVersion { Version = 1 }
1177 
1178     this();
1179     ~this();
1180 
1181     QVariant variant;
1182 }
1183 +/
1184 
1185 T qstyleoption_cast(T)(const(QStyleHintReturn)* hint)
1186 {
1187     /+ typename std::remove_cv<typename std::remove_pointer<T>::type>::type +/alias Opt = type;
1188     if (hint && hint.version_ <= Opt.Version &&
1189         (hint.type == Opt.Type || int(Opt.Type) == QStyleHintReturn.HintReturnType.SH_Default))
1190         return static_cast!(T)(hint);
1191     return null;
1192 }
1193 
1194 T qstyleoption_cast(T)(QStyleHintReturn* hint)
1195 {
1196     /+ typename std::remove_cv<typename std::remove_pointer<T>::type>::type +/alias Opt = type;
1197     if (hint && hint.version_ <= Opt.Version &&
1198         (hint.type == Opt.Type || int(Opt.Type) == QStyleHintReturn.HintReturnType.SH_Default))
1199         return static_cast!(T)(hint);
1200     return null;
1201 }
1202 
1203 /+ #if !defined(QT_NO_DEBUG_STREAM)
1204 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QStyleOption::OptionType &optionType);
1205 Q_WIDGETS_EXPORT QDebug operator<<(QDebug debug, const QStyleOption &option);
1206 #endif +/
1207