Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-01-18 10:09:38

0001 // Copyright (C) 2016 The Qt Company Ltd.
0002 // SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
0003 
0004 #ifndef QSTYLE_H
0005 #define QSTYLE_H
0006 
0007 #include <QtWidgets/qtwidgetsglobal.h>
0008 #include <QtCore/qobject.h>
0009 #include <QtCore/qrect.h>
0010 #include <QtCore/qsize.h>
0011 #include <QtGui/qicon.h>
0012 #include <QtGui/qpixmap.h>
0013 #include <QtGui/qpalette.h>
0014 #include <QtWidgets/qsizepolicy.h>
0015 
0016 QT_BEGIN_NAMESPACE
0017 
0018 
0019 class QAction;
0020 class QDebug;
0021 class QTab;
0022 class QFontMetrics;
0023 class QStyleHintReturn;
0024 class QStyleOption;
0025 class QStyleOptionComplex;
0026 class QStylePrivate;
0027 
0028 class Q_WIDGETS_EXPORT QStyle : public QObject
0029 {
0030     Q_OBJECT
0031     Q_DECLARE_PRIVATE(QStyle)
0032 
0033 protected:
0034     QStyle(QStylePrivate &dd);
0035 
0036 public:
0037     QStyle();
0038     virtual ~QStyle();
0039 
0040     QString name() const;
0041 
0042     virtual void polish(QWidget *widget);
0043     virtual void unpolish(QWidget *widget);
0044 
0045     virtual void polish(QApplication *application);
0046     virtual void unpolish(QApplication *application);
0047 
0048     virtual void polish(QPalette &palette);
0049 
0050     virtual QRect itemTextRect(const QFontMetrics &fm, const QRect &r,
0051                            int flags, bool enabled,
0052                            const QString &text) const;
0053 
0054     virtual QRect itemPixmapRect(const QRect &r, int flags, const QPixmap &pixmap) const;
0055 
0056     virtual void drawItemText(QPainter *painter, const QRect &rect,
0057                               int flags, const QPalette &pal, bool enabled,
0058                               const QString &text, QPalette::ColorRole textRole = QPalette::NoRole) const;
0059 
0060     virtual void drawItemPixmap(QPainter *painter, const QRect &rect,
0061                                 int alignment, const QPixmap &pixmap) const;
0062 
0063     virtual QPalette standardPalette() const;
0064 
0065     enum StateFlag {
0066         State_None =                0x00000000,
0067         State_Enabled =             0x00000001,
0068         State_Raised =              0x00000002,
0069         State_Sunken =              0x00000004,
0070         State_Off =                 0x00000008,
0071         State_NoChange =            0x00000010,
0072         State_On =                  0x00000020,
0073         State_DownArrow =           0x00000040,
0074         State_Horizontal =          0x00000080,
0075         State_HasFocus =            0x00000100,
0076         State_Top =                 0x00000200,
0077         State_Bottom =              0x00000400,
0078         State_FocusAtBorder =       0x00000800,
0079         State_AutoRaise =           0x00001000,
0080         State_MouseOver =           0x00002000,
0081         State_UpArrow =             0x00004000,
0082         State_Selected =            0x00008000,
0083         State_Active =              0x00010000,
0084         State_Window =              0x00020000,
0085         State_Open =                0x00040000,
0086         State_Children =            0x00080000,
0087         State_Item =                0x00100000,
0088         State_Sibling =             0x00200000,
0089         State_Editing =             0x00400000,
0090         State_KeyboardFocusChange = 0x00800000,
0091 #ifdef QT_KEYPAD_NAVIGATION
0092         State_HasEditFocus =        0x01000000,
0093 #endif
0094         State_ReadOnly =            0x02000000,
0095         State_Small =               0x04000000,
0096         State_Mini =                0x08000000
0097     };
0098     Q_ENUM(StateFlag)
0099     Q_DECLARE_FLAGS(State, StateFlag)
0100 
0101 
0102     enum PrimitiveElement {
0103         PE_Frame,
0104         PE_FrameDefaultButton,
0105         PE_FrameDockWidget,
0106         PE_FrameFocusRect,
0107         PE_FrameGroupBox,
0108         PE_FrameLineEdit,
0109         PE_FrameMenu,
0110         PE_FrameStatusBarItem,
0111         PE_FrameTabWidget,
0112         PE_FrameWindow,
0113         PE_FrameButtonBevel,
0114         PE_FrameButtonTool,
0115         PE_FrameTabBarBase,
0116 
0117         PE_PanelButtonCommand,
0118         PE_PanelButtonBevel,
0119         PE_PanelButtonTool,
0120         PE_PanelMenuBar,
0121         PE_PanelToolBar,
0122         PE_PanelLineEdit,
0123 
0124         PE_IndicatorArrowDown,
0125         PE_IndicatorArrowLeft,
0126         PE_IndicatorArrowRight,
0127         PE_IndicatorArrowUp,
0128         PE_IndicatorBranch,
0129         PE_IndicatorButtonDropDown,
0130         PE_IndicatorItemViewItemCheck,
0131         PE_IndicatorCheckBox,
0132         PE_IndicatorDockWidgetResizeHandle,
0133         PE_IndicatorHeaderArrow,
0134         PE_IndicatorMenuCheckMark,
0135         PE_IndicatorProgressChunk,
0136         PE_IndicatorRadioButton,
0137         PE_IndicatorSpinDown,
0138         PE_IndicatorSpinMinus,
0139         PE_IndicatorSpinPlus,
0140         PE_IndicatorSpinUp,
0141         PE_IndicatorToolBarHandle,
0142         PE_IndicatorToolBarSeparator,
0143         PE_PanelTipLabel,
0144         PE_IndicatorTabTear,
0145         PE_IndicatorTabTearLeft = PE_IndicatorTabTear,
0146         PE_PanelScrollAreaCorner,
0147 
0148         PE_Widget,
0149 
0150         PE_IndicatorColumnViewArrow,
0151         PE_IndicatorItemViewItemDrop,
0152 
0153         PE_PanelItemViewItem,
0154         PE_PanelItemViewRow,
0155 
0156         PE_PanelStatusBar,
0157 
0158         PE_IndicatorTabClose,
0159         PE_PanelMenu,
0160 
0161         PE_IndicatorTabTearRight,
0162 
0163         // do not add any values below/greater this
0164         PE_CustomBase = 0xf000000
0165     };
0166     Q_ENUM(PrimitiveElement)
0167 
0168     virtual void drawPrimitive(PrimitiveElement pe, const QStyleOption *opt, QPainter *p,
0169                                const QWidget *w = nullptr) const = 0;
0170     enum ControlElement {
0171         CE_PushButton,
0172         CE_PushButtonBevel,
0173         CE_PushButtonLabel,
0174 
0175         CE_CheckBox,
0176         CE_CheckBoxLabel,
0177 
0178         CE_RadioButton,
0179         CE_RadioButtonLabel,
0180 
0181         CE_TabBarTab,
0182         CE_TabBarTabShape,
0183         CE_TabBarTabLabel,
0184 
0185         CE_ProgressBar,
0186         CE_ProgressBarGroove,
0187         CE_ProgressBarContents,
0188         CE_ProgressBarLabel,
0189 
0190         CE_MenuItem,
0191         CE_MenuScroller,
0192         CE_MenuVMargin,
0193         CE_MenuHMargin,
0194         CE_MenuTearoff,
0195         CE_MenuEmptyArea,
0196 
0197         CE_MenuBarItem,
0198         CE_MenuBarEmptyArea,
0199 
0200         CE_ToolButtonLabel,
0201 
0202         CE_Header,
0203         CE_HeaderSection,
0204         CE_HeaderLabel,
0205 
0206         CE_ToolBoxTab,
0207         CE_SizeGrip,
0208         CE_Splitter,
0209         CE_RubberBand,
0210         CE_DockWidgetTitle,
0211 
0212         CE_ScrollBarAddLine,
0213         CE_ScrollBarSubLine,
0214         CE_ScrollBarAddPage,
0215         CE_ScrollBarSubPage,
0216         CE_ScrollBarSlider,
0217         CE_ScrollBarFirst,
0218         CE_ScrollBarLast,
0219 
0220         CE_FocusFrame,
0221         CE_ComboBoxLabel,
0222 
0223         CE_ToolBar,
0224         CE_ToolBoxTabShape,
0225         CE_ToolBoxTabLabel,
0226         CE_HeaderEmptyArea,
0227 
0228         CE_ColumnViewGrip,
0229 
0230         CE_ItemViewItem,
0231 
0232         CE_ShapedFrame,
0233 
0234         // do not add any values below/greater than this
0235         CE_CustomBase = 0xf0000000
0236     };
0237     Q_ENUM(ControlElement)
0238 
0239     virtual void drawControl(ControlElement element, const QStyleOption *opt, QPainter *p,
0240                              const QWidget *w = nullptr) const = 0;
0241 
0242     enum SubElement {
0243         SE_PushButtonContents,
0244         SE_PushButtonFocusRect,
0245 
0246         SE_CheckBoxIndicator,
0247         SE_CheckBoxContents,
0248         SE_CheckBoxFocusRect,
0249         SE_CheckBoxClickRect,
0250 
0251         SE_RadioButtonIndicator,
0252         SE_RadioButtonContents,
0253         SE_RadioButtonFocusRect,
0254         SE_RadioButtonClickRect,
0255 
0256         SE_ComboBoxFocusRect,
0257 
0258         SE_SliderFocusRect,
0259 
0260         SE_ProgressBarGroove,
0261         SE_ProgressBarContents,
0262         SE_ProgressBarLabel,
0263 
0264         SE_ToolBoxTabContents,
0265 
0266         SE_HeaderLabel,
0267         SE_HeaderArrow,
0268 
0269         SE_TabWidgetTabBar,
0270         SE_TabWidgetTabPane,
0271         SE_TabWidgetTabContents,
0272         SE_TabWidgetLeftCorner,
0273         SE_TabWidgetRightCorner,
0274 
0275         SE_ItemViewItemCheckIndicator,
0276         SE_TabBarTearIndicator,
0277         SE_TabBarTearIndicatorLeft = SE_TabBarTearIndicator,
0278 
0279         SE_TreeViewDisclosureItem,
0280 
0281         SE_LineEditContents,
0282         SE_FrameContents,
0283 
0284         SE_DockWidgetCloseButton,
0285         SE_DockWidgetFloatButton,
0286         SE_DockWidgetTitleBarText,
0287         SE_DockWidgetIcon,
0288 
0289         SE_CheckBoxLayoutItem,
0290         SE_ComboBoxLayoutItem,
0291         SE_DateTimeEditLayoutItem,
0292         SE_LabelLayoutItem,
0293         SE_ProgressBarLayoutItem,
0294         SE_PushButtonLayoutItem,
0295         SE_RadioButtonLayoutItem,
0296         SE_SliderLayoutItem,
0297         SE_SpinBoxLayoutItem,
0298         SE_ToolButtonLayoutItem,
0299 
0300         SE_FrameLayoutItem,
0301         SE_GroupBoxLayoutItem,
0302         SE_TabWidgetLayoutItem,
0303 
0304         SE_ItemViewItemDecoration,
0305         SE_ItemViewItemText,
0306         SE_ItemViewItemFocusRect,
0307 
0308         SE_TabBarTabLeftButton,
0309         SE_TabBarTabRightButton,
0310         SE_TabBarTabText,
0311 
0312         SE_ShapedFrameContents,
0313 
0314         SE_ToolBarHandle,
0315 
0316         SE_TabBarScrollLeftButton,
0317         SE_TabBarScrollRightButton,
0318         SE_TabBarTearIndicatorRight,
0319 
0320         SE_PushButtonBevel,
0321 
0322         // do not add any values below/greater than this
0323         SE_CustomBase = 0xf0000000
0324     };
0325     Q_ENUM(SubElement)
0326 
0327     virtual QRect subElementRect(SubElement subElement, const QStyleOption *option,
0328                                  const QWidget *widget = nullptr) const = 0;
0329 
0330 
0331     enum ComplexControl {
0332         CC_SpinBox,
0333         CC_ComboBox,
0334         CC_ScrollBar,
0335         CC_Slider,
0336         CC_ToolButton,
0337         CC_TitleBar,
0338         CC_Dial,
0339         CC_GroupBox,
0340         CC_MdiControls,
0341 
0342         // do not add any values below/greater than this
0343         CC_CustomBase = 0xf0000000
0344     };
0345     Q_ENUM(ComplexControl)
0346 
0347     enum SubControl {
0348         SC_None =                  0x00000000,
0349 
0350         SC_ScrollBarAddLine =      0x00000001,
0351         SC_ScrollBarSubLine =      0x00000002,
0352         SC_ScrollBarAddPage =      0x00000004,
0353         SC_ScrollBarSubPage =      0x00000008,
0354         SC_ScrollBarFirst =        0x00000010,
0355         SC_ScrollBarLast =         0x00000020,
0356         SC_ScrollBarSlider =       0x00000040,
0357         SC_ScrollBarGroove =       0x00000080,
0358 
0359         SC_SpinBoxUp =             0x00000001,
0360         SC_SpinBoxDown =           0x00000002,
0361         SC_SpinBoxFrame =          0x00000004,
0362         SC_SpinBoxEditField =      0x00000008,
0363 
0364         SC_ComboBoxFrame =         0x00000001,
0365         SC_ComboBoxEditField =     0x00000002,
0366         SC_ComboBoxArrow =         0x00000004,
0367         SC_ComboBoxListBoxPopup =  0x00000008,
0368 
0369         SC_SliderGroove =          0x00000001,
0370         SC_SliderHandle =          0x00000002,
0371         SC_SliderTickmarks =       0x00000004,
0372 
0373         SC_ToolButton =            0x00000001,
0374         SC_ToolButtonMenu =        0x00000002,
0375 
0376         SC_TitleBarSysMenu =       0x00000001,
0377         SC_TitleBarMinButton =     0x00000002,
0378         SC_TitleBarMaxButton =     0x00000004,
0379         SC_TitleBarCloseButton =   0x00000008,
0380         SC_TitleBarNormalButton =  0x00000010,
0381         SC_TitleBarShadeButton =   0x00000020,
0382         SC_TitleBarUnshadeButton = 0x00000040,
0383         SC_TitleBarContextHelpButton = 0x00000080,
0384         SC_TitleBarLabel =         0x00000100,
0385 
0386         SC_DialGroove =            0x00000001,
0387         SC_DialHandle =            0x00000002,
0388         SC_DialTickmarks =         0x00000004,
0389 
0390         SC_GroupBoxCheckBox =      0x00000001,
0391         SC_GroupBoxLabel =         0x00000002,
0392         SC_GroupBoxContents =      0x00000004,
0393         SC_GroupBoxFrame =         0x00000008,
0394 
0395         SC_MdiMinButton     =      0x00000001,
0396         SC_MdiNormalButton  =      0x00000002,
0397         SC_MdiCloseButton   =      0x00000004,
0398 
0399         SC_CustomBase =            0xf0000000,
0400         SC_All =                   0xffffffff
0401     };
0402     Q_ENUM(SubControl)
0403     Q_DECLARE_FLAGS(SubControls, SubControl)
0404 
0405 
0406     virtual void drawComplexControl(ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p,
0407                                     const QWidget *widget = nullptr) const = 0;
0408     virtual SubControl hitTestComplexControl(ComplexControl cc, const QStyleOptionComplex *opt,
0409                                              const QPoint &pt, const QWidget *widget = nullptr) const = 0;
0410     virtual QRect subControlRect(ComplexControl cc, const QStyleOptionComplex *opt,
0411                                  SubControl sc, const QWidget *widget = nullptr) const = 0;
0412 
0413     enum PixelMetric {
0414         PM_ButtonMargin,
0415         PM_ButtonDefaultIndicator,
0416         PM_MenuButtonIndicator,
0417         PM_ButtonShiftHorizontal,
0418         PM_ButtonShiftVertical,
0419 
0420         PM_DefaultFrameWidth,
0421         PM_SpinBoxFrameWidth,
0422         PM_ComboBoxFrameWidth,
0423 
0424         PM_MaximumDragDistance,
0425 
0426         PM_ScrollBarExtent,
0427         PM_ScrollBarSliderMin,
0428 
0429         PM_SliderThickness,             // total slider thickness
0430         PM_SliderControlThickness,      // thickness of the business part
0431         PM_SliderLength,                // total length of slider
0432         PM_SliderTickmarkOffset,        //
0433         PM_SliderSpaceAvailable,        // available space for slider to move
0434 
0435         PM_DockWidgetSeparatorExtent,
0436         PM_DockWidgetHandleExtent,
0437         PM_DockWidgetFrameWidth,
0438 
0439         PM_TabBarTabOverlap,
0440         PM_TabBarTabHSpace,
0441         PM_TabBarTabVSpace,
0442         PM_TabBarBaseHeight,
0443         PM_TabBarBaseOverlap,
0444 
0445         PM_ProgressBarChunkWidth,
0446 
0447         PM_SplitterWidth,
0448         PM_TitleBarHeight,
0449 
0450         PM_MenuScrollerHeight,
0451         PM_MenuHMargin,
0452         PM_MenuVMargin,
0453         PM_MenuPanelWidth,
0454         PM_MenuTearoffHeight,
0455         PM_MenuDesktopFrameWidth,
0456 
0457         PM_MenuBarPanelWidth,
0458         PM_MenuBarItemSpacing,
0459         PM_MenuBarVMargin,
0460         PM_MenuBarHMargin,
0461 
0462         PM_IndicatorWidth,
0463         PM_IndicatorHeight,
0464         PM_ExclusiveIndicatorWidth,
0465         PM_ExclusiveIndicatorHeight,
0466 
0467         PM_DialogButtonsSeparator,
0468         PM_DialogButtonsButtonWidth,
0469         PM_DialogButtonsButtonHeight,
0470 
0471         PM_MdiSubWindowFrameWidth,
0472         PM_MdiSubWindowMinimizedWidth,
0473 
0474         PM_HeaderMargin,
0475         PM_HeaderMarkSize,
0476         PM_HeaderGripMargin,
0477         PM_TabBarTabShiftHorizontal,
0478         PM_TabBarTabShiftVertical,
0479         PM_TabBarScrollButtonWidth,
0480 
0481         PM_ToolBarFrameWidth,
0482         PM_ToolBarHandleExtent,
0483         PM_ToolBarItemSpacing,
0484         PM_ToolBarItemMargin,
0485         PM_ToolBarSeparatorExtent,
0486         PM_ToolBarExtensionExtent,
0487 
0488         PM_SpinBoxSliderHeight,
0489 
0490         PM_ToolBarIconSize,
0491         PM_ListViewIconSize,
0492         PM_IconViewIconSize,
0493         PM_SmallIconSize,
0494         PM_LargeIconSize,
0495 
0496         PM_FocusFrameVMargin,
0497         PM_FocusFrameHMargin,
0498 
0499         PM_ToolTipLabelFrameWidth,
0500         PM_CheckBoxLabelSpacing,
0501         PM_TabBarIconSize,
0502         PM_SizeGripSize,
0503         PM_DockWidgetTitleMargin,
0504         PM_MessageBoxIconSize,
0505         PM_ButtonIconSize,
0506 
0507         PM_DockWidgetTitleBarButtonMargin,
0508 
0509         PM_RadioButtonLabelSpacing,
0510         PM_LayoutLeftMargin,
0511         PM_LayoutTopMargin,
0512         PM_LayoutRightMargin,
0513         PM_LayoutBottomMargin,
0514         PM_LayoutHorizontalSpacing,
0515         PM_LayoutVerticalSpacing,
0516         PM_TabBar_ScrollButtonOverlap,
0517 
0518         PM_TextCursorWidth,
0519 
0520         PM_TabCloseIndicatorWidth,
0521         PM_TabCloseIndicatorHeight,
0522 
0523         PM_ScrollView_ScrollBarSpacing,
0524         PM_ScrollView_ScrollBarOverlap,
0525         PM_SubMenuOverlap,
0526         PM_TreeViewIndentation,
0527 
0528         PM_HeaderDefaultSectionSizeHorizontal,
0529         PM_HeaderDefaultSectionSizeVertical,
0530 
0531         PM_TitleBarButtonIconSize,
0532         PM_TitleBarButtonSize,
0533 
0534         PM_LineEditIconSize,
0535         PM_LineEditIconMargin,
0536         // do not add any values below/greater than this
0537         PM_CustomBase = 0xf0000000
0538     };
0539     Q_ENUM(PixelMetric)
0540 
0541     virtual int pixelMetric(PixelMetric metric, const QStyleOption *option = nullptr,
0542                             const QWidget *widget = nullptr) const = 0;
0543 
0544     enum ContentsType {
0545         CT_PushButton,
0546         CT_CheckBox,
0547         CT_RadioButton,
0548         CT_ToolButton,
0549         CT_ComboBox,
0550         CT_Splitter,
0551         CT_ProgressBar,
0552         CT_MenuItem,
0553         CT_MenuBarItem,
0554         CT_MenuBar,
0555         CT_Menu,
0556         CT_TabBarTab,
0557         CT_Slider,
0558         CT_ScrollBar,
0559         CT_LineEdit,
0560         CT_SpinBox,
0561         CT_SizeGrip,
0562         CT_TabWidget,
0563         CT_DialogButtons,
0564         CT_HeaderSection,
0565         CT_GroupBox,
0566         CT_MdiControls,
0567         CT_ItemViewItem,
0568         // do not add any values below/greater than this
0569         CT_CustomBase = 0xf0000000
0570     };
0571     Q_ENUM(ContentsType)
0572 
0573     virtual QSize sizeFromContents(ContentsType ct, const QStyleOption *opt,
0574                                    const QSize &contentsSize, const QWidget *w = nullptr) const = 0;
0575 
0576     enum RequestSoftwareInputPanel {
0577         RSIP_OnMouseClickAndAlreadyFocused,
0578         RSIP_OnMouseClick
0579     };
0580     Q_ENUM(RequestSoftwareInputPanel)
0581 
0582     enum StyleHint {
0583         SH_EtchDisabledText,
0584         SH_DitherDisabledText,
0585         SH_ScrollBar_MiddleClickAbsolutePosition,
0586         SH_ScrollBar_ScrollWhenPointerLeavesControl,
0587         SH_TabBar_SelectMouseType,
0588         SH_TabBar_Alignment,
0589         SH_Header_ArrowAlignment,
0590         SH_Slider_SnapToValue,
0591         SH_Slider_SloppyKeyEvents,
0592         SH_ProgressDialog_CenterCancelButton,
0593         SH_ProgressDialog_TextLabelAlignment,
0594         SH_PrintDialog_RightAlignButtons,
0595         SH_MainWindow_SpaceBelowMenuBar,
0596         SH_FontDialog_SelectAssociatedText,
0597         SH_Menu_AllowActiveAndDisabled,
0598         SH_Menu_SpaceActivatesItem,
0599         SH_Menu_SubMenuPopupDelay,
0600         SH_ScrollView_FrameOnlyAroundContents,
0601         SH_MenuBar_AltKeyNavigation,
0602         SH_ComboBox_ListMouseTracking,
0603         SH_Menu_MouseTracking,
0604         SH_MenuBar_MouseTracking,
0605         SH_ItemView_ChangeHighlightOnFocus,
0606         SH_Widget_ShareActivation,
0607         SH_Workspace_FillSpaceOnMaximize,
0608         SH_ComboBox_Popup,
0609         SH_TitleBar_NoBorder,
0610         SH_Slider_StopMouseOverSlider,
0611         SH_BlinkCursorWhenTextSelected,
0612         SH_RichText_FullWidthSelection,
0613         SH_Menu_Scrollable,
0614         SH_GroupBox_TextLabelVerticalAlignment,
0615         SH_GroupBox_TextLabelColor,
0616         SH_Menu_SloppySubMenus,
0617         SH_Table_GridLineColor,
0618         SH_LineEdit_PasswordCharacter,
0619         SH_DialogButtons_DefaultButton,
0620         SH_ToolBox_SelectedPageTitleBold,
0621         SH_TabBar_PreferNoArrows,
0622         SH_ScrollBar_LeftClickAbsolutePosition,
0623         SH_ListViewExpand_SelectMouseType,
0624         SH_UnderlineShortcut,
0625         SH_SpinBox_AnimateButton,
0626         SH_SpinBox_KeyPressAutoRepeatRate,
0627         SH_SpinBox_ClickAutoRepeatRate,
0628         SH_Menu_FillScreenWithScroll,
0629         SH_ToolTipLabel_Opacity,
0630         SH_DrawMenuBarSeparator,
0631         SH_TitleBar_ModifyNotification,
0632         SH_Button_FocusPolicy,
0633         SH_MessageBox_UseBorderForButtonSpacing,
0634         SH_TitleBar_AutoRaise,
0635         SH_ToolButton_PopupDelay,
0636         SH_FocusFrame_Mask,
0637         SH_RubberBand_Mask,
0638         SH_WindowFrame_Mask,
0639         SH_SpinControls_DisableOnBounds,
0640         SH_Dial_BackgroundRole,
0641         SH_ComboBox_LayoutDirection,
0642         SH_ItemView_EllipsisLocation,
0643         SH_ItemView_ShowDecorationSelected,
0644         SH_ItemView_ActivateItemOnSingleClick,
0645         SH_ScrollBar_ContextMenu,
0646         SH_ScrollBar_RollBetweenButtons,
0647         SH_Slider_AbsoluteSetButtons,
0648         SH_Slider_PageSetButtons,
0649         SH_Menu_KeyboardSearch,
0650         SH_TabBar_ElideMode,
0651         SH_DialogButtonLayout,
0652         SH_ComboBox_PopupFrameStyle,
0653         SH_MessageBox_TextInteractionFlags,
0654         SH_DialogButtonBox_ButtonsHaveIcons,
0655         SH_MessageBox_CenterButtons,
0656         SH_Menu_SelectionWrap,
0657         SH_ItemView_MovementWithoutUpdatingSelection,
0658         SH_ToolTip_Mask,
0659         SH_FocusFrame_AboveWidget,
0660         SH_TextControl_FocusIndicatorTextCharFormat,
0661         SH_WizardStyle,
0662         SH_ItemView_ArrowKeysNavigateIntoChildren,
0663         SH_Menu_Mask,
0664         SH_Menu_FlashTriggeredItem,
0665         SH_Menu_FadeOutOnHide,
0666         SH_SpinBox_ClickAutoRepeatThreshold,
0667         SH_ItemView_PaintAlternatingRowColorsForEmptyArea,
0668         SH_FormLayoutWrapPolicy,
0669         SH_TabWidget_DefaultTabPosition,
0670         SH_ToolBar_Movable,
0671         SH_FormLayoutFieldGrowthPolicy,
0672         SH_FormLayoutFormAlignment,
0673         SH_FormLayoutLabelAlignment,
0674         SH_ItemView_DrawDelegateFrame,
0675         SH_TabBar_CloseButtonPosition,
0676         SH_DockWidget_ButtonsHaveFrame,
0677         SH_ToolButtonStyle,
0678         SH_RequestSoftwareInputPanel,
0679         SH_ScrollBar_Transient,
0680         SH_Menu_SupportsSections,
0681         SH_ToolTip_WakeUpDelay,
0682         SH_ToolTip_FallAsleepDelay,
0683         SH_Widget_Animate,
0684         SH_Splitter_OpaqueResize,
0685         // Whether we should use a native popup.
0686         // Only supported for non-editable combo boxes on Mac OS X so far.
0687         SH_ComboBox_UseNativePopup,
0688         SH_LineEdit_PasswordMaskDelay,
0689         SH_TabBar_ChangeCurrentDelay,
0690         SH_Menu_SubMenuUniDirection,
0691         SH_Menu_SubMenuUniDirectionFailCount,
0692         SH_Menu_SubMenuSloppySelectOtherActions,
0693         SH_Menu_SubMenuSloppyCloseTimeout,
0694         SH_Menu_SubMenuResetWhenReenteringParent,
0695         SH_Menu_SubMenuDontStartSloppyOnLeave,
0696         SH_ItemView_ScrollMode,
0697         SH_TitleBar_ShowToolTipsOnButtons,
0698         SH_Widget_Animation_Duration,
0699         SH_ComboBox_AllowWheelScrolling,
0700         SH_SpinBox_ButtonsInsideFrame,
0701         SH_SpinBox_StepModifier,
0702         SH_TabBar_AllowWheelScrolling,
0703         SH_Table_AlwaysDrawLeftTopGridLines,
0704         SH_SpinBox_SelectOnStep,
0705         // Add new style hint values here
0706 
0707         SH_CustomBase = 0xf0000000
0708     };
0709     Q_ENUM(StyleHint)
0710 
0711     virtual int styleHint(StyleHint stylehint, const QStyleOption *opt = nullptr,
0712                           const QWidget *widget = nullptr, QStyleHintReturn* returnData = nullptr) const = 0;
0713 
0714     enum StandardPixmap {
0715         SP_TitleBarMenuButton,
0716         SP_TitleBarMinButton,
0717         SP_TitleBarMaxButton,
0718         SP_TitleBarCloseButton,
0719         SP_TitleBarNormalButton,
0720         SP_TitleBarShadeButton,
0721         SP_TitleBarUnshadeButton,
0722         SP_TitleBarContextHelpButton,
0723         SP_DockWidgetCloseButton,
0724         SP_MessageBoxInformation,
0725         SP_MessageBoxWarning,
0726         SP_MessageBoxCritical,
0727         SP_MessageBoxQuestion,
0728         SP_DesktopIcon,
0729         SP_TrashIcon,
0730         SP_ComputerIcon,
0731         SP_DriveFDIcon,
0732         SP_DriveHDIcon,
0733         SP_DriveCDIcon,
0734         SP_DriveDVDIcon,
0735         SP_DriveNetIcon,
0736         SP_DirOpenIcon,
0737         SP_DirClosedIcon,
0738         SP_DirLinkIcon,
0739         SP_DirLinkOpenIcon,
0740         SP_FileIcon,
0741         SP_FileLinkIcon,
0742         SP_ToolBarHorizontalExtensionButton,
0743         SP_ToolBarVerticalExtensionButton,
0744         SP_FileDialogStart,
0745         SP_FileDialogEnd,
0746         SP_FileDialogToParent,
0747         SP_FileDialogNewFolder,
0748         SP_FileDialogDetailedView,
0749         SP_FileDialogInfoView,
0750         SP_FileDialogContentsView,
0751         SP_FileDialogListView,
0752         SP_FileDialogBack,
0753         SP_DirIcon,
0754         SP_DialogOkButton,
0755         SP_DialogCancelButton,
0756         SP_DialogHelpButton,
0757         SP_DialogOpenButton,
0758         SP_DialogSaveButton,
0759         SP_DialogCloseButton,
0760         SP_DialogApplyButton,
0761         SP_DialogResetButton,
0762         SP_DialogDiscardButton,
0763         SP_DialogYesButton,
0764         SP_DialogNoButton,
0765         SP_ArrowUp,
0766         SP_ArrowDown,
0767         SP_ArrowLeft,
0768         SP_ArrowRight,
0769         SP_ArrowBack,
0770         SP_ArrowForward,
0771         SP_DirHomeIcon,
0772         SP_CommandLink,
0773         SP_VistaShield,
0774         SP_BrowserReload,
0775         SP_BrowserStop,
0776         SP_MediaPlay,
0777         SP_MediaStop,
0778         SP_MediaPause,
0779         SP_MediaSkipForward,
0780         SP_MediaSkipBackward,
0781         SP_MediaSeekForward,
0782         SP_MediaSeekBackward,
0783         SP_MediaVolume,
0784         SP_MediaVolumeMuted,
0785         SP_LineEditClearButton,
0786         SP_DialogYesToAllButton,
0787         SP_DialogNoToAllButton,
0788         SP_DialogSaveAllButton,
0789         SP_DialogAbortButton,
0790         SP_DialogRetryButton,
0791         SP_DialogIgnoreButton,
0792         SP_RestoreDefaultsButton,
0793         SP_TabCloseButton,
0794         NStandardPixmap, // assertion value for sync with QPlatformTheme::StandardPixmap
0795         // do not add any values below/greater than this
0796         SP_CustomBase = 0xf0000000
0797     };
0798     Q_ENUM(StandardPixmap)
0799 
0800     virtual QPixmap standardPixmap(StandardPixmap standardPixmap, const QStyleOption *opt = nullptr,
0801                                    const QWidget *widget = nullptr) const = 0;
0802 
0803     virtual QIcon standardIcon(StandardPixmap standardIcon, const QStyleOption *option = nullptr,
0804                                const QWidget *widget = nullptr) const = 0;
0805 
0806     virtual QPixmap generatedIconPixmap(QIcon::Mode iconMode, const QPixmap &pixmap,
0807                                         const QStyleOption *opt) const = 0;
0808 
0809     static QRect visualRect(Qt::LayoutDirection direction, const QRect &boundingRect,
0810                             const QRect &logicalRect);
0811     static QPoint visualPos(Qt::LayoutDirection direction, const QRect &boundingRect,
0812                             const QPoint &logicalPos);
0813     static int sliderPositionFromValue(int min, int max, int val, int space,
0814                                        bool upsideDown = false);
0815     static int sliderValueFromPosition(int min, int max, int pos, int space,
0816                                        bool upsideDown = false);
0817     static Qt::Alignment visualAlignment(Qt::LayoutDirection direction, Qt::Alignment alignment);
0818     static QRect alignedRect(Qt::LayoutDirection direction, Qt::Alignment alignment,
0819                              const QSize &size, const QRect &rectangle);
0820 
0821     virtual int layoutSpacing(QSizePolicy::ControlType control1,
0822                               QSizePolicy::ControlType control2, Qt::Orientation orientation,
0823                               const QStyleOption *option = nullptr, const QWidget *widget = nullptr) const = 0;
0824     int combinedLayoutSpacing(QSizePolicy::ControlTypes controls1,
0825                               QSizePolicy::ControlTypes controls2, Qt::Orientation orientation,
0826                               QStyleOption *option = nullptr, QWidget *widget = nullptr) const;
0827 
0828     const QStyle * proxy() const;
0829 
0830 private:
0831     void setName(const QString &name);
0832 
0833 private:
0834     Q_DISABLE_COPY(QStyle)
0835     friend class QWidget;
0836     friend class QWidgetPrivate;
0837     friend class QApplication;
0838     friend class QProxyStyle;
0839     friend class QProxyStylePrivate;
0840     friend class QStyleFactory;
0841     void setProxy(QStyle *style);
0842 };
0843 
0844 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::State)
0845 Q_DECLARE_OPERATORS_FOR_FLAGS(QStyle::SubControls)
0846 
0847 QT_END_NAMESPACE
0848 
0849 #endif // QSTYLE_H