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
QStyle Class Referenceabstract

The QStyle class is an abstract base class that encapsulates the look and feel of a GUI. More...

#include <qstyle.h>

+ Inheritance diagram for QStyle:
+ Collaboration diagram for QStyle:

Public Types

enum  StateFlag {
  State_None = 0x00000000 , State_Enabled = 0x00000001 , State_Raised = 0x00000002 , State_Sunken = 0x00000004 ,
  State_Off = 0x00000008 , State_NoChange = 0x00000010 , State_On = 0x00000020 , State_DownArrow = 0x00000040 ,
  State_Horizontal = 0x00000080 , State_HasFocus = 0x00000100 , State_Top = 0x00000200 , State_Bottom = 0x00000400 ,
  State_FocusAtBorder = 0x00000800 , State_AutoRaise = 0x00001000 , State_MouseOver = 0x00002000 , State_UpArrow = 0x00004000 ,
  State_Selected = 0x00008000 , State_Active = 0x00010000 , State_Window = 0x00020000 , State_Open = 0x00040000 ,
  State_Children = 0x00080000 , State_Item = 0x00100000 , State_Sibling = 0x00200000 , State_Editing = 0x00400000 ,
  State_KeyboardFocusChange = 0x00800000 , State_ReadOnly = 0x02000000 , State_Small = 0x04000000 , State_Mini = 0x08000000
}
 This enum describes flags that are used when drawing primitive elements. More...
 
enum  PrimitiveElement {
  PE_Frame , PE_FrameDefaultButton , PE_FrameDockWidget , PE_FrameFocusRect ,
  PE_FrameGroupBox , PE_FrameLineEdit , PE_FrameMenu , PE_FrameStatusBarItem ,
  PE_FrameTabWidget , PE_FrameWindow , PE_FrameButtonBevel , PE_FrameButtonTool ,
  PE_FrameTabBarBase , PE_PanelButtonCommand , PE_PanelButtonBevel , PE_PanelButtonTool ,
  PE_PanelMenuBar , PE_PanelToolBar , PE_PanelLineEdit , PE_IndicatorArrowDown ,
  PE_IndicatorArrowLeft , PE_IndicatorArrowRight , PE_IndicatorArrowUp , PE_IndicatorBranch ,
  PE_IndicatorButtonDropDown , PE_IndicatorItemViewItemCheck , PE_IndicatorCheckBox , PE_IndicatorDockWidgetResizeHandle ,
  PE_IndicatorHeaderArrow , PE_IndicatorMenuCheckMark , PE_IndicatorProgressChunk , PE_IndicatorRadioButton ,
  PE_IndicatorSpinDown , PE_IndicatorSpinMinus , PE_IndicatorSpinPlus , PE_IndicatorSpinUp ,
  PE_IndicatorToolBarHandle , PE_IndicatorToolBarSeparator , PE_PanelTipLabel , PE_IndicatorTabTear ,
  PE_IndicatorTabTearLeft = PE_IndicatorTabTear , PE_PanelScrollAreaCorner , PE_Widget , PE_IndicatorColumnViewArrow ,
  PE_IndicatorItemViewItemDrop , PE_PanelItemViewItem , PE_PanelItemViewRow , PE_PanelStatusBar ,
  PE_IndicatorTabClose , PE_PanelMenu , PE_IndicatorTabTearRight , PE_CustomBase = 0xf000000
}
 This enum describes the various primitive elements. More...
 
enum  ControlElement {
  CE_PushButton , CE_PushButtonBevel , CE_PushButtonLabel , CE_CheckBox ,
  CE_CheckBoxLabel , CE_RadioButton , CE_RadioButtonLabel , CE_TabBarTab ,
  CE_TabBarTabShape , CE_TabBarTabLabel , CE_ProgressBar , CE_ProgressBarGroove ,
  CE_ProgressBarContents , CE_ProgressBarLabel , CE_MenuItem , CE_MenuScroller ,
  CE_MenuVMargin , CE_MenuHMargin , CE_MenuTearoff , CE_MenuEmptyArea ,
  CE_MenuBarItem , CE_MenuBarEmptyArea , CE_ToolButtonLabel , CE_Header ,
  CE_HeaderSection , CE_HeaderLabel , CE_ToolBoxTab , CE_SizeGrip ,
  CE_Splitter , CE_RubberBand , CE_DockWidgetTitle , CE_ScrollBarAddLine ,
  CE_ScrollBarSubLine , CE_ScrollBarAddPage , CE_ScrollBarSubPage , CE_ScrollBarSlider ,
  CE_ScrollBarFirst , CE_ScrollBarLast , CE_FocusFrame , CE_ComboBoxLabel ,
  CE_ToolBar , CE_ToolBoxTabShape , CE_ToolBoxTabLabel , CE_HeaderEmptyArea ,
  CE_ColumnViewGrip , CE_ItemViewItem , CE_ShapedFrame , CE_CustomBase = 0xf0000000
}
 This enum represents a control element. More...
 
enum  SubElement {
  SE_PushButtonContents , SE_PushButtonFocusRect , SE_CheckBoxIndicator , SE_CheckBoxContents ,
  SE_CheckBoxFocusRect , SE_CheckBoxClickRect , SE_RadioButtonIndicator , SE_RadioButtonContents ,
  SE_RadioButtonFocusRect , SE_RadioButtonClickRect , SE_ComboBoxFocusRect , SE_SliderFocusRect ,
  SE_ProgressBarGroove , SE_ProgressBarContents , SE_ProgressBarLabel , SE_ToolBoxTabContents ,
  SE_HeaderLabel , SE_HeaderArrow , SE_TabWidgetTabBar , SE_TabWidgetTabPane ,
  SE_TabWidgetTabContents , SE_TabWidgetLeftCorner , SE_TabWidgetRightCorner , SE_ItemViewItemCheckIndicator ,
  SE_TabBarTearIndicator , SE_TabBarTearIndicatorLeft = SE_TabBarTearIndicator , SE_TreeViewDisclosureItem , SE_LineEditContents ,
  SE_FrameContents , SE_DockWidgetCloseButton , SE_DockWidgetFloatButton , SE_DockWidgetTitleBarText ,
  SE_DockWidgetIcon , SE_CheckBoxLayoutItem , SE_ComboBoxLayoutItem , SE_DateTimeEditLayoutItem ,
  SE_LabelLayoutItem , SE_ProgressBarLayoutItem , SE_PushButtonLayoutItem , SE_RadioButtonLayoutItem ,
  SE_SliderLayoutItem , SE_SpinBoxLayoutItem , SE_ToolButtonLayoutItem , SE_FrameLayoutItem ,
  SE_GroupBoxLayoutItem , SE_TabWidgetLayoutItem , SE_ItemViewItemDecoration , SE_ItemViewItemText ,
  SE_ItemViewItemFocusRect , SE_TabBarTabLeftButton , SE_TabBarTabRightButton , SE_TabBarTabText ,
  SE_ShapedFrameContents , SE_ToolBarHandle , SE_TabBarScrollLeftButton , SE_TabBarScrollRightButton ,
  SE_TabBarTearIndicatorRight , SE_PushButtonBevel , SE_CustomBase = 0xf0000000
}
 This enum represents a sub-area of a widget. More...
 
enum  ComplexControl {
  CC_SpinBox , CC_ComboBox , CC_ScrollBar , CC_Slider ,
  CC_ToolButton , CC_TitleBar , CC_Dial , CC_GroupBox ,
  CC_MdiControls , CC_CustomBase = 0xf0000000
}
 This enum describes the available complex controls. More...
 
enum  SubControl {
  SC_None = 0x00000000 , SC_ScrollBarAddLine = 0x00000001 , SC_ScrollBarSubLine = 0x00000002 , SC_ScrollBarAddPage = 0x00000004 ,
  SC_ScrollBarSubPage = 0x00000008 , SC_ScrollBarFirst = 0x00000010 , SC_ScrollBarLast = 0x00000020 , SC_ScrollBarSlider = 0x00000040 ,
  SC_ScrollBarGroove = 0x00000080 , SC_SpinBoxUp = 0x00000001 , SC_SpinBoxDown = 0x00000002 , SC_SpinBoxFrame = 0x00000004 ,
  SC_SpinBoxEditField = 0x00000008 , SC_ComboBoxFrame = 0x00000001 , SC_ComboBoxEditField = 0x00000002 , SC_ComboBoxArrow = 0x00000004 ,
  SC_ComboBoxListBoxPopup = 0x00000008 , SC_SliderGroove = 0x00000001 , SC_SliderHandle = 0x00000002 , SC_SliderTickmarks = 0x00000004 ,
  SC_ToolButton = 0x00000001 , SC_ToolButtonMenu = 0x00000002 , SC_TitleBarSysMenu = 0x00000001 , SC_TitleBarMinButton = 0x00000002 ,
  SC_TitleBarMaxButton = 0x00000004 , SC_TitleBarCloseButton = 0x00000008 , SC_TitleBarNormalButton = 0x00000010 , SC_TitleBarShadeButton = 0x00000020 ,
  SC_TitleBarUnshadeButton = 0x00000040 , SC_TitleBarContextHelpButton = 0x00000080 , SC_TitleBarLabel = 0x00000100 , SC_DialGroove = 0x00000001 ,
  SC_DialHandle = 0x00000002 , SC_DialTickmarks = 0x00000004 , SC_GroupBoxCheckBox = 0x00000001 , SC_GroupBoxLabel = 0x00000002 ,
  SC_GroupBoxContents = 0x00000004 , SC_GroupBoxFrame = 0x00000008 , SC_MdiMinButton = 0x00000001 , SC_MdiNormalButton = 0x00000002 ,
  SC_MdiCloseButton = 0x00000004 , SC_CustomBase = 0xf0000000 , SC_All = 0xffffffff
}
 This enum describes the available sub controls. More...
 
enum  PixelMetric {
  PM_ButtonMargin , PM_ButtonDefaultIndicator , PM_MenuButtonIndicator , PM_ButtonShiftHorizontal ,
  PM_ButtonShiftVertical , PM_DefaultFrameWidth , PM_SpinBoxFrameWidth , PM_ComboBoxFrameWidth ,
  PM_MaximumDragDistance , PM_ScrollBarExtent , PM_ScrollBarSliderMin , PM_SliderThickness ,
  PM_SliderControlThickness , PM_SliderLength , PM_SliderTickmarkOffset , PM_SliderSpaceAvailable ,
  PM_DockWidgetSeparatorExtent , PM_DockWidgetHandleExtent , PM_DockWidgetFrameWidth , PM_TabBarTabOverlap ,
  PM_TabBarTabHSpace , PM_TabBarTabVSpace , PM_TabBarBaseHeight , PM_TabBarBaseOverlap ,
  PM_ProgressBarChunkWidth , PM_SplitterWidth , PM_TitleBarHeight , PM_MenuScrollerHeight ,
  PM_MenuHMargin , PM_MenuVMargin , PM_MenuPanelWidth , PM_MenuTearoffHeight ,
  PM_MenuDesktopFrameWidth , PM_MenuBarPanelWidth , PM_MenuBarItemSpacing , PM_MenuBarVMargin ,
  PM_MenuBarHMargin , PM_IndicatorWidth , PM_IndicatorHeight , PM_ExclusiveIndicatorWidth ,
  PM_ExclusiveIndicatorHeight , PM_MdiSubWindowFrameWidth = 44 , PM_MdiSubWindowMinimizedWidth , PM_HeaderMargin ,
  PM_HeaderMarkSize , PM_HeaderGripMargin , PM_TabBarTabShiftHorizontal , PM_TabBarTabShiftVertical ,
  PM_TabBarScrollButtonWidth , PM_ToolBarFrameWidth , PM_ToolBarHandleExtent , PM_ToolBarItemSpacing ,
  PM_ToolBarItemMargin , PM_ToolBarSeparatorExtent , PM_ToolBarExtensionExtent , PM_SpinBoxSliderHeight ,
  PM_ToolBarIconSize , PM_ListViewIconSize , PM_IconViewIconSize , PM_SmallIconSize ,
  PM_LargeIconSize , PM_FocusFrameVMargin , PM_FocusFrameHMargin , PM_ToolTipLabelFrameWidth ,
  PM_CheckBoxLabelSpacing , PM_TabBarIconSize , PM_SizeGripSize , PM_DockWidgetTitleMargin ,
  PM_MessageBoxIconSize , PM_ButtonIconSize , PM_DockWidgetTitleBarButtonMargin , PM_RadioButtonLabelSpacing ,
  PM_LayoutLeftMargin , PM_LayoutTopMargin , PM_LayoutRightMargin , PM_LayoutBottomMargin ,
  PM_LayoutHorizontalSpacing , PM_LayoutVerticalSpacing , PM_TabBar_ScrollButtonOverlap , PM_TextCursorWidth ,
  PM_TabCloseIndicatorWidth , PM_TabCloseIndicatorHeight , PM_ScrollView_ScrollBarSpacing , PM_ScrollView_ScrollBarOverlap ,
  PM_SubMenuOverlap , PM_TreeViewIndentation , PM_HeaderDefaultSectionSizeHorizontal , PM_HeaderDefaultSectionSizeVertical ,
  PM_TitleBarButtonIconSize , PM_TitleBarButtonSize , PM_LineEditIconSize , PM_LineEditIconMargin ,
  PM_CustomBase = 0xf0000000
}
 This enum describes the various available pixel metrics. More...
 
enum  ContentsType {
  CT_PushButton , CT_CheckBox , CT_RadioButton , CT_ToolButton ,
  CT_ComboBox , CT_Splitter , CT_ProgressBar , CT_MenuItem ,
  CT_MenuBarItem , CT_MenuBar , CT_Menu , CT_TabBarTab ,
  CT_Slider , CT_ScrollBar , CT_LineEdit , CT_SpinBox ,
  CT_SizeGrip , CT_TabWidget , CT_DialogButtons , CT_HeaderSection ,
  CT_GroupBox , CT_MdiControls , CT_ItemViewItem , CT_CustomBase = 0xf0000000
}
 This enum describes the available contents types. More...
 
enum  RequestSoftwareInputPanel { RSIP_OnMouseClickAndAlreadyFocused , RSIP_OnMouseClick }
 This enum describes under what circumstances a software input panel will be requested by input capable widgets. More...
 
enum  StyleHint {
  SH_EtchDisabledText , SH_DitherDisabledText , SH_ScrollBar_MiddleClickAbsolutePosition , SH_ScrollBar_ScrollWhenPointerLeavesControl ,
  SH_TabBar_SelectMouseType , SH_TabBar_Alignment , SH_Header_ArrowAlignment , SH_Slider_SnapToValue ,
  SH_Slider_SloppyKeyEvents , SH_ProgressDialog_CenterCancelButton , SH_ProgressDialog_TextLabelAlignment , SH_PrintDialog_RightAlignButtons ,
  SH_MainWindow_SpaceBelowMenuBar , SH_FontDialog_SelectAssociatedText , SH_Menu_AllowActiveAndDisabled , SH_Menu_SpaceActivatesItem ,
  SH_Menu_SubMenuPopupDelay , SH_ScrollView_FrameOnlyAroundContents , SH_MenuBar_AltKeyNavigation , SH_ComboBox_ListMouseTracking ,
  SH_Menu_MouseTracking , SH_MenuBar_MouseTracking , SH_ItemView_ChangeHighlightOnFocus , SH_Widget_ShareActivation ,
  SH_Workspace_FillSpaceOnMaximize , SH_ComboBox_Popup , SH_TitleBar_NoBorder , SH_Slider_StopMouseOverSlider ,
  SH_BlinkCursorWhenTextSelected , SH_RichText_FullWidthSelection , SH_Menu_Scrollable , SH_GroupBox_TextLabelVerticalAlignment ,
  SH_GroupBox_TextLabelColor , SH_Menu_SloppySubMenus , SH_Table_GridLineColor , SH_LineEdit_PasswordCharacter ,
  SH_DialogButtons_DefaultButton , SH_ToolBox_SelectedPageTitleBold , SH_TabBar_PreferNoArrows , SH_ScrollBar_LeftClickAbsolutePosition ,
  SH_ListViewExpand_SelectMouseType , SH_UnderlineShortcut , SH_SpinBox_AnimateButton , SH_SpinBox_KeyPressAutoRepeatRate ,
  SH_SpinBox_ClickAutoRepeatRate , SH_Menu_FillScreenWithScroll , SH_ToolTipLabel_Opacity , SH_DrawMenuBarSeparator ,
  SH_TitleBar_ModifyNotification , SH_Button_FocusPolicy , SH_MessageBox_UseBorderForButtonSpacing , SH_TitleBar_AutoRaise ,
  SH_ToolButton_PopupDelay , SH_FocusFrame_Mask , SH_RubberBand_Mask , SH_WindowFrame_Mask ,
  SH_SpinControls_DisableOnBounds , SH_Dial_BackgroundRole , SH_ComboBox_LayoutDirection , SH_ItemView_EllipsisLocation ,
  SH_ItemView_ShowDecorationSelected , SH_ItemView_ActivateItemOnSingleClick , SH_ScrollBar_ContextMenu , SH_ScrollBar_RollBetweenButtons ,
  SH_Slider_AbsoluteSetButtons , SH_Slider_PageSetButtons , SH_Menu_KeyboardSearch , SH_TabBar_ElideMode ,
  SH_DialogButtonLayout , SH_ComboBox_PopupFrameStyle , SH_MessageBox_TextInteractionFlags , SH_DialogButtonBox_ButtonsHaveIcons ,
  SH_MessageBox_CenterButtons , SH_Menu_SelectionWrap , SH_ItemView_MovementWithoutUpdatingSelection , SH_ToolTip_Mask ,
  SH_FocusFrame_AboveWidget , SH_TextControl_FocusIndicatorTextCharFormat , SH_WizardStyle , SH_ItemView_ArrowKeysNavigateIntoChildren ,
  SH_Menu_Mask , SH_Menu_FlashTriggeredItem , SH_Menu_FadeOutOnHide , SH_SpinBox_ClickAutoRepeatThreshold ,
  SH_ItemView_PaintAlternatingRowColorsForEmptyArea , SH_FormLayoutWrapPolicy , SH_TabWidget_DefaultTabPosition , SH_ToolBar_Movable ,
  SH_FormLayoutFieldGrowthPolicy , SH_FormLayoutFormAlignment , SH_FormLayoutLabelAlignment , SH_ItemView_DrawDelegateFrame ,
  SH_TabBar_CloseButtonPosition , SH_DockWidget_ButtonsHaveFrame , SH_ToolButtonStyle , SH_RequestSoftwareInputPanel ,
  SH_ScrollBar_Transient , SH_Menu_SupportsSections , SH_ToolTip_WakeUpDelay , SH_ToolTip_FallAsleepDelay ,
  SH_Widget_Animate , SH_Splitter_OpaqueResize , SH_ComboBox_UseNativePopup , SH_LineEdit_PasswordMaskDelay ,
  SH_TabBar_ChangeCurrentDelay , SH_Menu_SubMenuUniDirection , SH_Menu_SubMenuUniDirectionFailCount , SH_Menu_SubMenuSloppySelectOtherActions ,
  SH_Menu_SubMenuSloppyCloseTimeout , SH_Menu_SubMenuResetWhenReenteringParent , SH_Menu_SubMenuDontStartSloppyOnLeave , SH_ItemView_ScrollMode ,
  SH_TitleBar_ShowToolTipsOnButtons , SH_Widget_Animation_Duration , SH_ComboBox_AllowWheelScrolling , SH_SpinBox_ButtonsInsideFrame ,
  SH_SpinBox_StepModifier , SH_TabBar_AllowWheelScrolling , SH_Table_AlwaysDrawLeftTopGridLines , SH_SpinBox_SelectOnStep ,
  SH_CustomBase = 0xf0000000
}
 This enum describes the available style hints. More...
 
enum  StandardPixmap {
  SP_TitleBarMenuButton , SP_TitleBarMinButton , SP_TitleBarMaxButton , SP_TitleBarCloseButton ,
  SP_TitleBarNormalButton , SP_TitleBarShadeButton , SP_TitleBarUnshadeButton , SP_TitleBarContextHelpButton ,
  SP_DockWidgetCloseButton , SP_MessageBoxInformation , SP_MessageBoxWarning , SP_MessageBoxCritical ,
  SP_MessageBoxQuestion , SP_DesktopIcon , SP_TrashIcon , SP_ComputerIcon ,
  SP_DriveFDIcon , SP_DriveHDIcon , SP_DriveCDIcon , SP_DriveDVDIcon ,
  SP_DriveNetIcon , SP_DirOpenIcon , SP_DirClosedIcon , SP_DirLinkIcon ,
  SP_DirLinkOpenIcon , SP_FileIcon , SP_FileLinkIcon , SP_ToolBarHorizontalExtensionButton ,
  SP_ToolBarVerticalExtensionButton , SP_FileDialogStart , SP_FileDialogEnd , SP_FileDialogToParent ,
  SP_FileDialogNewFolder , SP_FileDialogDetailedView , SP_FileDialogInfoView , SP_FileDialogContentsView ,
  SP_FileDialogListView , SP_FileDialogBack , SP_DirIcon , SP_DialogOkButton ,
  SP_DialogCancelButton , SP_DialogHelpButton , SP_DialogOpenButton , SP_DialogSaveButton ,
  SP_DialogCloseButton , SP_DialogApplyButton , SP_DialogResetButton , SP_DialogDiscardButton ,
  SP_DialogYesButton , SP_DialogNoButton , SP_ArrowUp , SP_ArrowDown ,
  SP_ArrowLeft , SP_ArrowRight , SP_ArrowBack , SP_ArrowForward ,
  SP_DirHomeIcon , SP_CommandLink , SP_VistaShield , SP_BrowserReload ,
  SP_BrowserStop , SP_MediaPlay , SP_MediaStop , SP_MediaPause ,
  SP_MediaSkipForward , SP_MediaSkipBackward , SP_MediaSeekForward , SP_MediaSeekBackward ,
  SP_MediaVolume , SP_MediaVolumeMuted , SP_LineEditClearButton , SP_DialogYesToAllButton ,
  SP_DialogNoToAllButton , SP_DialogSaveAllButton , SP_DialogAbortButton , SP_DialogRetryButton ,
  SP_DialogIgnoreButton , SP_RestoreDefaultsButton , SP_TabCloseButton , NStandardPixmap ,
  SP_CustomBase = 0xf0000000
}
 This enum describes the available standard pixmaps. More...
 

Public Member Functions

 QStyle ()
 Constructs a style object.
 
virtual ~QStyle ()
 Destroys the style object.
 
QString name () const
 Returns the name of the style.
 
virtual void polish (QWidget *widget)
 Initializes the appearance of the given widget.
 
virtual void unpolish (QWidget *widget)
 Uninitialize the given {widget}'s appearance.
 
virtual void polish (QApplication *application)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Late initialization of the given application object.
 
virtual void unpolish (QApplication *application)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Uninitialize the given application.
 
virtual void polish (QPalette &palette)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Changes the palette according to style specific requirements for color palettes (if any).
 
virtual QRect itemTextRect (const QFontMetrics &fm, const QRect &r, int flags, bool enabled, const QString &text) const
 Returns the area within the given rectangle in which to draw the provided text according to the specified font metrics and alignment.
 
virtual QRect itemPixmapRect (const QRect &r, int flags, const QPixmap &pixmap) const
 Returns the area within the given rectangle in which to draw the specified pixmap according to the defined alignment.
 
virtual void drawItemText (QPainter *painter, const QRect &rect, int flags, const QPalette &pal, bool enabled, const QString &text, QPalette::ColorRole textRole=QPalette::NoRole) const
 Draws the given text in the specified rectangle using the provided painter and palette.
 
virtual void drawItemPixmap (QPainter *painter, const QRect &rect, int alignment, const QPixmap &pixmap) const
 Draws the given pixmap in the specified rectangle, according to the specified alignment, using the provided painter.
 
virtual QPalette standardPalette () const
 Returns the style's standard palette.
 
virtual void drawPrimitive (PrimitiveElement pe, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
 Draws the given primitive element with the provided painter using the style options specified by option.
 
virtual void drawControl (ControlElement element, const QStyleOption *opt, QPainter *p, const QWidget *w=nullptr) const =0
 Draws the given element with the provided painter with the style options specified by option.
 
virtual QRect subElementRect (SubElement subElement, const QStyleOption *option, const QWidget *widget=nullptr) const =0
 Returns the sub-area for the given element as described in the provided style option.
 
virtual void drawComplexControl (ComplexControl cc, const QStyleOptionComplex *opt, QPainter *p, const QWidget *widget=nullptr) const =0
 Draws the given control using the provided painter with the style options specified by option.
 
virtual SubControl hitTestComplexControl (ComplexControl cc, const QStyleOptionComplex *opt, const QPoint &pt, const QWidget *widget=nullptr) const =0
 Returns the sub control at the given position in the given complex control (with the style options specified by option).
 
virtual QRect subControlRect (ComplexControl cc, const QStyleOptionComplex *opt, SubControl sc, const QWidget *widget=nullptr) const =0
 Returns the rectangle containing the specified subControl of the given complex control (with the style specified by option).
 
virtual int pixelMetric (PixelMetric metric, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
 Returns the value of the given pixel metric.
 
virtual QSize sizeFromContents (ContentsType ct, const QStyleOption *opt, const QSize &contentsSize, const QWidget *w=nullptr) const =0
 Returns the size of the element described by the specified option and type, based on the provided contentsSize.
 
virtual int styleHint (StyleHint stylehint, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr, QStyleHintReturn *returnData=nullptr) const =0
 Returns an integer representing the specified style hint for the given widget described by the provided style option.
 
virtual QPixmap standardPixmap (StandardPixmap standardPixmap, const QStyleOption *opt=nullptr, const QWidget *widget=nullptr) const =0
 
virtual QIcon standardIcon (StandardPixmap standardIcon, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
 
virtual QPixmap generatedIconPixmap (QIcon::Mode iconMode, const QPixmap &pixmap, const QStyleOption *opt) const =0
 Returns a copy of the given pixmap, styled to conform to the specified iconMode and taking into account the palette specified by option.
 
virtual int layoutSpacing (QSizePolicy::ControlType control1, QSizePolicy::ControlType control2, Qt::Orientation orientation, const QStyleOption *option=nullptr, const QWidget *widget=nullptr) const =0
 
int combinedLayoutSpacing (QSizePolicy::ControlTypes controls1, QSizePolicy::ControlTypes controls2, Qt::Orientation orientation, QStyleOption *option=nullptr, QWidget *widget=nullptr) const
 
const QStyleproxy () const
 
- Public Member Functions inherited from QObject
Q_INVOKABLE QObject (QObject *parent=nullptr)
 Constructs an object with parent object parent.
 
virtual ~QObject ()
 Destroys the object, deleting all its child objects.
 
virtual bool event (QEvent *event)
 This virtual function receives events to an object and should return true if the event e was recognized and processed.
 
virtual bool eventFilter (QObject *watched, QEvent *event)
 Filters events if this object has been installed as an event filter for the watched object.
 
QString objectName () const
 
Q_WEAK_OVERLOAD void setObjectName (const QString &name)
 Sets the object's name to name.
 
void setObjectName (QAnyStringView name)
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
QBindable< QStringbindableObjectName ()
 
bool isWidgetType () const
 Returns true if the object is a widget; otherwise returns false.
 
bool isWindowType () const
 Returns true if the object is a window; otherwise returns false.
 
bool isQuickItemType () const
 Returns true if the object is a QQuickItem; otherwise returns false.
 
bool signalsBlocked () const noexcept
 Returns true if signals are blocked; otherwise returns false.
 
bool blockSignals (bool b) noexcept
 If block is true, signals emitted by this object are blocked (i.e., emitting a signal will not invoke anything connected to it).
 
QThreadthread () const
 Returns the thread in which the object lives.
 
bool moveToThread (QThread *thread QT6_DECL_NEW_OVERLOAD_TAIL)
 Changes the thread affinity for this object and its children and returns true on success.
 
int startTimer (int interval, Qt::TimerType timerType=Qt::CoarseTimer)
 This is an overloaded function that will start a timer of type timerType and a timeout of interval milliseconds.
 
int startTimer (std::chrono::nanoseconds time, Qt::TimerType timerType=Qt::CoarseTimer)
 
void killTimer (int id)
 Kills the timer with timer identifier, id.
 
void killTimer (Qt::TimerId id)
 
template<typename T >
findChild (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns the child of this object that can be cast into type T and that is called name, or \nullptr if there is no such object.
 
template<typename T >
QList< T > findChildren (QAnyStringView aName, Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 Returns all children of this object with the given name that can be cast to type T, or an empty list if there are no such objects.
 
template<typename T >
findChild (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
template<typename T >
QList< T > findChildren (Qt::FindChildOptions options=Qt::FindChildrenRecursively) const
 This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
 
const QObjectListchildren () const
 Returns a list of child objects.
 
void setParent (QObject *parent)
 Makes the object a child of parent.
 
void installEventFilter (QObject *filterObj)
 Installs an event filter filterObj on this object.
 
void removeEventFilter (QObject *obj)
 Removes an event filter object obj from this object.
 
QMetaObject::Connection connect (const QObject *sender, const char *signal, const char *member, Qt::ConnectionType type=Qt::AutoConnection) const
 
bool disconnect (const char *signal=nullptr, const QObject *receiver=nullptr, const char *member=nullptr) const
 
bool disconnect (const QObject *receiver, const char *member=nullptr) const
 
void dumpObjectTree () const
 Dumps a tree of children to the debug output.
 
void dumpObjectInfo () const
 Dumps information about signal connections, etc.
 
bool setProperty (const char *name, const QVariant &value)
 Sets the value of the object's name property to value.
 
bool setProperty (const char *name, QVariant &&value)
 
QVariant property (const char *name) const
 Returns the value of the object's name property.
 
QList< QByteArraydynamicPropertyNames () const
 
QBindingStoragebindingStorage ()
 
const QBindingStoragebindingStorage () const
 
QObjectparent () const
 Returns a pointer to the parent object.
 
bool inherits (const char *classname) const
 Returns true if this object is an instance of a class that inherits className or a QObject subclass that inherits className; otherwise returns false.
 

Static Public Member Functions

static QRect visualRect (Qt::LayoutDirection direction, const QRect &boundingRect, const QRect &logicalRect)
 Returns the given logicalRectangle converted to screen coordinates based on the specified direction.
 
static QPoint visualPos (Qt::LayoutDirection direction, const QRect &boundingRect, const QPoint &logicalPos)
 Returns the given logicalPosition converted to screen coordinates based on the specified direction.
 
static int sliderPositionFromValue (int min, int max, int val, int space, bool upsideDown=false)
 Converts the given logicalValue to a pixel position.
 
static int sliderValueFromPosition (int min, int max, int pos, int space, bool upsideDown=false)
 Converts the given pixel position to a logical value.
 
static Qt::Alignment visualAlignment (Qt::LayoutDirection direction, Qt::Alignment alignment)
 Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLeft or Qt::AlignRight with Qt::AlignAbsolute according to the layout direction.
 
static QRect alignedRect (Qt::LayoutDirection direction, Qt::Alignment alignment, const QSize &size, const QRect &rectangle)
 Returns a new rectangle of the specified size that is aligned to the given rectangle according to the specified alignment and direction.
 
- Static Public Member Functions inherited from QObject
static QMetaObject::Connection connect (const QObject *sender, const char *signal, const QObject *receiver, const char *member, Qt::ConnectionType=Qt::AutoConnection)
 \threadsafe
 
static QMetaObject::Connection connect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &method, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::ContextTypeForFunctor< Func2 >::ContextType *context, Func2 &&slot, Qt::ConnectionType type=Qt::AutoConnection)
 
template<typename Func1 , typename Func2 >
static QMetaObject::Connection connect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, Func2 &&slot)
 
static bool disconnect (const QObject *sender, const char *signal, const QObject *receiver, const char *member)
 \threadsafe
 
static bool disconnect (const QObject *sender, const QMetaMethod &signal, const QObject *receiver, const QMetaMethod &member)
 
static bool disconnect (const QMetaObject::Connection &)
 Disconnect a connection.
 
template<typename Func1 , typename Func2 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const typename QtPrivate::FunctionPointer< Func2 >::Object *receiver, Func2 slot)
 
template<typename Func1 >
static bool disconnect (const typename QtPrivate::FunctionPointer< Func1 >::Object *sender, Func1 signal, const QObject *receiver, void **zero)
 

Protected Member Functions

 QStyle (QStylePrivate &dd)
 
- Protected Member Functions inherited from QObject
QObjectsender () const
 Returns a pointer to the object that sent the signal, if called in a slot activated by a signal; otherwise it returns \nullptr.
 
int senderSignalIndex () const
 
int receivers (const char *signal) const
 Returns the number of receivers connected to the signal.
 
bool isSignalConnected (const QMetaMethod &signal) const
 
virtual void timerEvent (QTimerEvent *event)
 This event handler can be reimplemented in a subclass to receive timer events for the object.
 
virtual void childEvent (QChildEvent *event)
 This event handler can be reimplemented in a subclass to receive child events.
 
virtual void customEvent (QEvent *event)
 This event handler can be reimplemented in a subclass to receive custom events.
 
virtual void connectNotify (const QMetaMethod &signal)
 
virtual void disconnectNotify (const QMetaMethod &signal)
 
 QObject (QObjectPrivate &dd, QObject *parent=nullptr)
 

Friends

class QWidget
 
class QWidgetPrivate
 
class QApplication
 
class QProxyStyle
 
class QProxyStylePrivate
 
class QStyleFactory
 
class QStyleSheetProxySaver
 

Additional Inherited Members

- Public Slots inherited from QObject
void deleteLater ()
 \threadsafe
 
- Signals inherited from QObject
void destroyed (QObject *=nullptr)
 This signal is emitted immediately before the object obj is destroyed, after any instances of QPointer have been notified, and cannot be blocked.
 
void objectNameChanged (const QString &objectName, QPrivateSignal)
 This signal is emitted after the object's name has been changed.
 
- Protected Attributes inherited from QObject
QScopedPointer< QObjectDatad_ptr
 
- Properties inherited from QObject
QString objectName
 the name of this object
 

Detailed Description

The QStyle class is an abstract base class that encapsulates the look and feel of a GUI.

\inmodule QtWidgets

Qt contains a set of QStyle subclasses that emulate the styles of the different platforms supported by Qt (QWindowsStyle, QMacStyle etc.). By default, these styles are built into the Qt GUI module. Styles can also be made available as plugins.

Qt's built-in widgets use QStyle to perform nearly all of their drawing, ensuring that they look exactly like the equivalent native widgets. The diagram below shows a QComboBox in nine different styles.

Nine combo boxes

Topics:

Definition at line 28 of file qstyle.h.

Member Enumeration Documentation

◆ ComplexControl

This enum describes the available complex controls.

Complex controls have different behavior depending upon where the user clicks on them or which keys are pressed.

\value CC_SpinBox A spinbox, like QSpinBox. \value CC_ComboBox A combobox, like QComboBox. \value CC_ScrollBar A scroll bar, like QScrollBar. \value CC_Slider A slider, like QSlider. \value CC_ToolButton A tool button, like QToolButton. \value CC_TitleBar A Title bar, like those used in QMdiSubWindow. \value CC_GroupBox A group box, like QGroupBox. \value CC_Dial A dial, like QDial. \value CC_MdiControls The minimize, close, and normal button in the menu bar for a maximized MDI subwindow.

\value CC_CustomBase Base value for custom complex controls. Custom values must be greater than this value.

See also
SubControl, drawComplexControl()
Enumerator
CC_SpinBox 
CC_ComboBox 
CC_ScrollBar 
CC_Slider 
CC_ToolButton 
CC_TitleBar 
CC_Dial 
CC_GroupBox 
CC_MdiControls 
CC_CustomBase 

Definition at line 331 of file qstyle.h.

◆ ContentsType

This enum describes the available contents types.

These are used to calculate sizes for the contents of various widgets.

\value CT_CheckBox A check box, like QCheckBox. \value CT_ComboBox A combo box, like QComboBox. \omitvalue CT_DialogButtons \value CT_HeaderSection A header section, like QHeader. \value CT_LineEdit A line edit, like QLineEdit. \value CT_Menu A menu, like QMenu. \value CT_MenuBar A menu bar, like QMenuBar. \value CT_MenuBarItem A menu bar item, like the buttons in a QMenuBar. \value CT_MenuItem A menu item, like QMenuItem. \value CT_ProgressBar A progress bar, like QProgressBar. \value CT_PushButton A push button, like QPushButton. \value CT_RadioButton A radio button, like QRadioButton. \value CT_SizeGrip A size grip, like QSizeGrip. \value CT_Slider A slider, like QSlider. \value CT_ScrollBar A scroll bar, like QScrollBar. \value CT_SpinBox A spin box, like QSpinBox. \value CT_Splitter A splitter, like QSplitter. \value CT_TabBarTab A tab on a tab bar, like QTabBar. \value CT_TabWidget A tab widget, like QTabWidget. \value CT_ToolButton A tool button, like QToolButton. \value CT_GroupBox A group box, like QGroupBox. \value CT_ItemViewItem An item inside an item view.

\value CT_CustomBase Base value for custom contents types. Custom values must be greater than this value.

\value CT_MdiControls The minimize, normal, and close button in the menu bar for a maximized MDI subwindow.

See also
sizeFromContents()
Enumerator
CT_PushButton 
CT_CheckBox 
CT_RadioButton 
CT_ToolButton 
CT_ComboBox 
CT_Splitter 
CT_ProgressBar 
CT_MenuItem 
CT_MenuBarItem 
CT_MenuBar 
CT_Menu 
CT_TabBarTab 
CT_Slider 
CT_ScrollBar 
CT_LineEdit 
CT_SpinBox 
CT_SizeGrip 
CT_TabWidget 
CT_DialogButtons 
CT_HeaderSection 
CT_GroupBox 
CT_MdiControls 
CT_ItemViewItem 
CT_CustomBase 

Definition at line 546 of file qstyle.h.

◆ ControlElement

This enum represents a control element.

A control element is a part of a widget that performs some action or displays information to the user.

\value CE_PushButton A QPushButton, draws CE_PushButtonBevel, CE_PushButtonLabel and PE_FrameFocusRect. \value CE_PushButtonBevel The bevel and default indicator of a QPushButton. \value CE_PushButtonLabel The label (an icon with text or pixmap) of a QPushButton.

\value CE_DockWidgetTitle Dock window title. \value CE_Splitter Splitter handle; see also QSplitter.

\value CE_CheckBox A QCheckBox, draws a PE_IndicatorCheckBox, a CE_CheckBoxLabel and a PE_FrameFocusRect. \value CE_CheckBoxLabel The label (text or pixmap) of a QCheckBox.

\value CE_RadioButton A QRadioButton, draws a PE_IndicatorRadioButton, a CE_RadioButtonLabel and a PE_FrameFocusRect. \value CE_RadioButtonLabel The label (text or pixmap) of a QRadioButton.

\value CE_TabBarTab The tab and label within a QTabBar. \value CE_TabBarTabShape The tab shape within a tab bar. \value CE_TabBarTabLabel The label within a tab.

\value CE_ProgressBar A QProgressBar, draws CE_ProgressBarGroove, CE_ProgressBarContents and CE_ProgressBarLabel. \value CE_ProgressBarGroove The groove where the progress indicator is drawn in a QProgressBar. \value CE_ProgressBarContents The progress indicator of a QProgressBar. \value CE_ProgressBarLabel The text label of a QProgressBar.

\value CE_ToolButtonLabel A tool button's label.

\value CE_MenuBarItem A menu item in a QMenuBar. \value CE_MenuBarEmptyArea The empty area of a QMenuBar.

\value CE_MenuItem A menu item in a QMenu. \value CE_MenuScroller Scrolling areas in a QMenu when the style supports scrolling. \value CE_MenuTearoff A menu item representing the tear off section of a QMenu. \value CE_MenuEmptyArea The area in a menu without menu items. \value CE_MenuHMargin The horizontal extra space on the left/right of a menu. \value CE_MenuVMargin The vertical extra space on the top/bottom of a menu.

\value CE_ToolBoxTab The toolbox's tab and label within a QToolBox. \value CE_SizeGrip Window resize handle; see also QSizeGrip.

\value CE_Header A header. \value CE_HeaderSection A header section. \value CE_HeaderLabel The header's label.

\value CE_ScrollBarAddLine Scroll bar line increase indicator. (i.e., scroll down); see also QScrollBar. \value CE_ScrollBarSubLine Scroll bar line decrease indicator (i.e., scroll up). \value CE_ScrollBarAddPage Scolllbar page increase indicator (i.e., page down). \value CE_ScrollBarSubPage Scroll bar page decrease indicator (i.e., page up). \value CE_ScrollBarSlider Scroll bar slider. \value CE_ScrollBarFirst Scroll bar first line indicator (i.e., home). \value CE_ScrollBarLast Scroll bar last line indicator (i.e., end).

\value CE_RubberBand Rubber band used in for example an icon view.

\value CE_FocusFrame Focus frame that is style controlled.

\value CE_ItemViewItem An item inside an item view.

\value CE_CustomBase Base value for custom control elements; custom values must be greater than this value. \value CE_ComboBoxLabel The label of a non-editable QComboBox. \value CE_ToolBar A toolbar like QToolBar. \value CE_ToolBoxTabShape The toolbox's tab shape. \value CE_ToolBoxTabLabel The toolbox's tab label. \value CE_HeaderEmptyArea The area of a header view where there are no header sections.

\value CE_ShapedFrame The frame with the shape specified in the QStyleOptionFrame; see QFrame.

\omitvalue CE_ColumnViewGrip

See also
drawControl()
Enumerator
CE_PushButton 
CE_PushButtonBevel 
CE_PushButtonLabel 
CE_CheckBox 
CE_CheckBoxLabel 
CE_RadioButton 
CE_RadioButtonLabel 
CE_TabBarTab 
CE_TabBarTabShape 
CE_TabBarTabLabel 
CE_ProgressBar 
CE_ProgressBarGroove 
CE_ProgressBarContents 
CE_ProgressBarLabel 
CE_MenuItem 
CE_MenuScroller 
CE_MenuVMargin 
CE_MenuHMargin 
CE_MenuTearoff 
CE_MenuEmptyArea 
CE_MenuBarItem 
CE_MenuBarEmptyArea 
CE_ToolButtonLabel 
CE_Header 
CE_HeaderSection 
CE_HeaderLabel 
CE_ToolBoxTab 
CE_SizeGrip 
CE_Splitter 
CE_RubberBand 
CE_DockWidgetTitle 
CE_ScrollBarAddLine 
CE_ScrollBarSubLine 
CE_ScrollBarAddPage 
CE_ScrollBarSubPage 
CE_ScrollBarSlider 
CE_ScrollBarFirst 
CE_ScrollBarLast 
CE_FocusFrame 
CE_ComboBoxLabel 
CE_ToolBar 
CE_ToolBoxTabShape 
CE_ToolBoxTabLabel 
CE_HeaderEmptyArea 
CE_ColumnViewGrip 
CE_ItemViewItem 
CE_ShapedFrame 
CE_CustomBase 

Definition at line 170 of file qstyle.h.

◆ PixelMetric

This enum describes the various available pixel metrics.

A pixel metric is a style dependent size represented by a single pixel value.

\value PM_ButtonMargin Amount of whitespace between push button labels and the frame. \value PM_DockWidgetTitleBarButtonMargin Amount of whitespace between dock widget's title bar button labels and the frame. \value PM_ButtonDefaultIndicator Width of the default-button indicator frame. \value PM_MenuButtonIndicator Width of the menu button indicator proportional to the widget height. \value PM_ButtonShiftHorizontal Horizontal contents shift of a button when the button is down. \value PM_ButtonShiftVertical Vertical contents shift of a button when the button is down.

\value PM_DefaultFrameWidth Default frame width (usually 2). \value PM_SpinBoxFrameWidth Frame width of a spin box, defaults to PM_DefaultFrameWidth. \value PM_ComboBoxFrameWidth Frame width of a combo box, defaults to PM_DefaultFrameWidth.

\value PM_MdiSubWindowFrameWidth Frame width of an MDI window. \value PM_MdiSubWindowMinimizedWidth Width of a minimized MDI window.

\value PM_LayoutLeftMargin Default \l{QLayout::setContentsMargins()}{left margin} for a QLayout. \value PM_LayoutTopMargin Default \l{QLayout::setContentsMargins()}{top margin} for a QLayout. \value PM_LayoutRightMargin Default \l{QLayout::setContentsMargins()}{right margin} for a QLayout. \value PM_LayoutBottomMargin Default \l{QLayout::setContentsMargins()}{bottom margin} for a QLayout. \value PM_LayoutHorizontalSpacing Default \l{QLayout::spacing}{horizontal spacing} for a QLayout. \value PM_LayoutVerticalSpacing Default \l{QLayout::spacing}{vertical spacing} for a QLayout.

\value PM_MaximumDragDistance The maximum allowed distance between the mouse and a scrollbar when dragging. Exceeding the specified distance will cause the slider to jump back to the original position; a value of -1 disables this behavior.

\value PM_ScrollBarExtent Width of a vertical scroll bar and the height of a horizontal scroll bar. \value PM_ScrollBarSliderMin The minimum height of a vertical scroll bar's slider and the minimum width of a horizontal scroll bar's slider.

\value PM_SliderThickness Total slider thickness. \value PM_SliderControlThickness Thickness of the slider handle. \value PM_SliderLength Length of the slider. \value PM_SliderTickmarkOffset The offset between the tickmarks and the slider. \value PM_SliderSpaceAvailable The available space for the slider to move.

\value PM_DockWidgetSeparatorExtent Width of a separator in a horizontal dock window and the height of a separator in a vertical dock window. \value PM_DockWidgetHandleExtent Width of the handle in a horizontal dock window and the height of the handle in a vertical dock window. \value PM_DockWidgetFrameWidth Frame width of a dock window. \value PM_DockWidgetTitleMargin Margin of the dock window title.

\value PM_MenuBarPanelWidth Frame width of a menu bar, defaults to PM_DefaultFrameWidth. \value PM_MenuBarItemSpacing Spacing between menu bar items. \value PM_MenuBarHMargin Spacing between menu bar items and left/right of bar. \value PM_MenuBarVMargin Spacing between menu bar items and top/bottom of bar.

\value PM_ToolBarFrameWidth Width of the frame around toolbars. \value PM_ToolBarHandleExtent Width of a toolbar handle in a horizontal toolbar and the height of the handle in a vertical toolbar. \value PM_ToolBarItemMargin Spacing between the toolbar frame and the items. \value PM_ToolBarItemSpacing Spacing between toolbar items. \value PM_ToolBarSeparatorExtent Width of a toolbar separator in a horizontal toolbar and the height of a separator in a vertical toolbar. \value PM_ToolBarExtensionExtent Width of a toolbar extension button in a horizontal toolbar and the height of the button in a vertical toolbar.

\value PM_TabBarTabOverlap Number of pixels the tabs should overlap. (Currently only used in styles, not inside of QTabBar) \value PM_TabBarTabHSpace Extra space added to the tab width. \value PM_TabBarTabVSpace Extra space added to the tab height. \value PM_TabBarBaseHeight Height of the area between the tab bar and the tab pages. \value PM_TabBarBaseOverlap Number of pixels the tab bar overlaps the tab bar base. \value PM_TabBarScrollButtonWidth \value PM_TabBarTabShiftHorizontal Horizontal pixel shift when a tab is selected. \value PM_TabBarTabShiftVertical Vertical pixel shift when a tab is selected.

\value PM_ProgressBarChunkWidth Width of a chunk in a progress bar indicator.

\value PM_SplitterWidth Width of a splitter.

\value PM_TitleBarHeight Height of the title bar.

\value PM_IndicatorWidth Width of a check box indicator. \value PM_IndicatorHeight Height of a checkbox indicator. \value PM_ExclusiveIndicatorWidth Width of a radio button indicator. \value PM_ExclusiveIndicatorHeight Height of a radio button indicator.

\value PM_MenuPanelWidth Border width (applied on all sides) for a QMenu. \value PM_MenuHMargin Additional border (used on left and right) for a QMenu. \value PM_MenuVMargin Additional border (used for bottom and top) for a QMenu. \value PM_MenuScrollerHeight Height of the scroller area in a QMenu. \value PM_MenuTearoffHeight Height of a tear off area in a QMenu. \value PM_MenuDesktopFrameWidth The frame width for the menu on the desktop.

\omitvalue PM_DialogButtonsSeparator \omitvalue PM_DialogButtonsButtonWidth \omitvalue PM_DialogButtonsButtonHeight

\value PM_HeaderMarkSize The size of the sort indicator in a header. \value PM_HeaderGripMargin The size of the resize grip in a header. \value PM_HeaderMargin The size of the margin between the sort indicator and the text. \value PM_SpinBoxSliderHeight The height of the optional spin box slider.

\value PM_ToolBarIconSize Default tool bar icon size \value PM_SmallIconSize Default small icon size \value PM_LargeIconSize Default large icon size

\value PM_FocusFrameHMargin Horizontal margin that the focus frame will outset the widget by. \value PM_FocusFrameVMargin Vertical margin that the focus frame will outset the widget by. \value PM_IconViewIconSize The default size for icons in an icon view. \value PM_ListViewIconSize The default size for icons in a list view.

\value PM_ToolTipLabelFrameWidth The frame width for a tool tip label. \value PM_CheckBoxLabelSpacing The spacing between a check box indicator and its label. \value PM_RadioButtonLabelSpacing The spacing between a radio button indicator and its label. \value PM_TabBarIconSize The default icon size for a tab bar. \value PM_SizeGripSize The size of a size grip. \value PM_MessageBoxIconSize The size of the standard icons in a message box \value PM_ButtonIconSize The default size of button icons \value PM_TextCursorWidth The width of the cursor in a line edit or text edit \value PM_TabBar_ScrollButtonOverlap The distance between the left and right buttons in a tab bar.

\value PM_TabCloseIndicatorWidth The default width of a close button on a tab in a tab bar. \value PM_TabCloseIndicatorHeight The default height of a close button on a tab in a tab bar.

\value PM_ScrollView_ScrollBarSpacing Distance between frame and scrollbar with SH_ScrollView_FrameOnlyAroundContents set. \value PM_ScrollView_ScrollBarOverlap Overlap between scroll bars and scroll content

\value PM_SubMenuOverlap The horizontal overlap between a submenu and its parent.

\value [since 5.4] PM_TreeViewIndentation The indentation of items in a tree view.

\value PM_HeaderDefaultSectionSizeHorizontal The default size of sections in a horizontal header. This enum value has been introduced in Qt 5.5. \value PM_HeaderDefaultSectionSizeVertical The default size of sections in a vertical header. This enum value has been introduced in Qt 5.5.

\value [since 5.8] PM_TitleBarButtonIconSize The size of button icons on a title bar. \value [since 5.8] PM_TitleBarButtonSize The size of buttons on a title bar.

\value [since 6.2] PM_LineEditIconSize The default size for icons in a line edit.

\value [since 6.3] PM_LineEditIconMargin The margin around icons in a line edit.

\value PM_CustomBase Base value for custom pixel metrics. Custom values must be greater than this value.

See also
pixelMetric()
Enumerator
PM_ButtonMargin 
PM_ButtonDefaultIndicator 
PM_MenuButtonIndicator 
PM_ButtonShiftHorizontal 
PM_ButtonShiftVertical 
PM_DefaultFrameWidth 
PM_SpinBoxFrameWidth 
PM_ComboBoxFrameWidth 
PM_MaximumDragDistance 
PM_ScrollBarExtent 
PM_ScrollBarSliderMin 
PM_SliderThickness 
PM_SliderControlThickness 
PM_SliderLength 
PM_SliderTickmarkOffset 
PM_SliderSpaceAvailable 
PM_DockWidgetSeparatorExtent 
PM_DockWidgetHandleExtent 
PM_DockWidgetFrameWidth 
PM_TabBarTabOverlap 
PM_TabBarTabHSpace 
PM_TabBarTabVSpace 
PM_TabBarBaseHeight 
PM_TabBarBaseOverlap 
PM_ProgressBarChunkWidth 
PM_SplitterWidth 
PM_TitleBarHeight 
PM_MenuScrollerHeight 
PM_MenuHMargin 
PM_MenuVMargin 
PM_MenuPanelWidth 
PM_MenuTearoffHeight 
PM_MenuDesktopFrameWidth 
PM_MenuBarPanelWidth 
PM_MenuBarItemSpacing 
PM_MenuBarVMargin 
PM_MenuBarHMargin 
PM_IndicatorWidth 
PM_IndicatorHeight 
PM_ExclusiveIndicatorWidth 
PM_ExclusiveIndicatorHeight 
PM_MdiSubWindowFrameWidth 
PM_MdiSubWindowMinimizedWidth 
PM_HeaderMargin 
PM_HeaderMarkSize 
PM_HeaderGripMargin 
PM_TabBarTabShiftHorizontal 
PM_TabBarTabShiftVertical 
PM_TabBarScrollButtonWidth 
PM_ToolBarFrameWidth 
PM_ToolBarHandleExtent 
PM_ToolBarItemSpacing 
PM_ToolBarItemMargin 
PM_ToolBarSeparatorExtent 
PM_ToolBarExtensionExtent 
PM_SpinBoxSliderHeight 
PM_ToolBarIconSize 
PM_ListViewIconSize 
PM_IconViewIconSize 
PM_SmallIconSize 
PM_LargeIconSize 
PM_FocusFrameVMargin 
PM_FocusFrameHMargin 
PM_ToolTipLabelFrameWidth 
PM_CheckBoxLabelSpacing 
PM_TabBarIconSize 
PM_SizeGripSize 
PM_DockWidgetTitleMargin 
PM_MessageBoxIconSize 
PM_ButtonIconSize 
PM_DockWidgetTitleBarButtonMargin 
PM_RadioButtonLabelSpacing 
PM_LayoutLeftMargin 
PM_LayoutTopMargin 
PM_LayoutRightMargin 
PM_LayoutBottomMargin 
PM_LayoutHorizontalSpacing 
PM_LayoutVerticalSpacing 
PM_TabBar_ScrollButtonOverlap 
PM_TextCursorWidth 
PM_TabCloseIndicatorWidth 
PM_TabCloseIndicatorHeight 
PM_ScrollView_ScrollBarSpacing 
PM_ScrollView_ScrollBarOverlap 
PM_SubMenuOverlap 
PM_TreeViewIndentation 
PM_HeaderDefaultSectionSizeHorizontal 
PM_HeaderDefaultSectionSizeVertical 
PM_TitleBarButtonIconSize 
PM_TitleBarButtonSize 
PM_LineEditIconSize 
PM_LineEditIconMargin 
PM_CustomBase 

Definition at line 413 of file qstyle.h.

◆ PrimitiveElement

This enum describes the various primitive elements.

A primitive element is a common GUI element, such as a checkbox indicator or button bevel.

\value PE_PanelButtonCommand Button used to initiate an action, for example, a QPushButton.

\value PE_FrameDefaultButton This frame around a default button, e.g. in a dialog. \value PE_PanelButtonBevel Generic panel with a button bevel. \value PE_PanelButtonTool Panel for a Tool button, used with QToolButton. \value PE_PanelLineEdit Panel for a QLineEdit. \value PE_IndicatorButtonDropDown Indicator for a drop down button, for example, a tool button that displays a menu.

\value PE_FrameFocusRect Generic focus indicator.

\value PE_IndicatorArrowUp Generic Up arrow. \value PE_IndicatorArrowDown Generic Down arrow. \value PE_IndicatorArrowRight Generic Right arrow. \value PE_IndicatorArrowLeft Generic Left arrow.

\value PE_IndicatorSpinUp Up symbol for a spin widget, for example a QSpinBox. \value PE_IndicatorSpinDown Down symbol for a spin widget. \value PE_IndicatorSpinPlus Increase symbol for a spin widget. \value PE_IndicatorSpinMinus Decrease symbol for a spin widget.

\value PE_IndicatorItemViewItemCheck On/off indicator for a view item.

\value PE_IndicatorCheckBox On/off indicator, for example, a QCheckBox. \value PE_IndicatorRadioButton Exclusive on/off indicator, for example, a QRadioButton.

\value PE_IndicatorDockWidgetResizeHandle Resize handle for dock windows.

\value PE_Frame Generic frame \value PE_FrameMenu Frame for popup windows/menus; see also QMenu. \value PE_PanelMenuBar Panel for menu bars. \value PE_PanelScrollAreaCorner Panel at the bottom-right (or bottom-left) corner of a scroll area.

\value PE_FrameDockWidget Panel frame for dock windows and toolbars. \value PE_FrameTabWidget Frame for tab widgets. \value PE_FrameLineEdit Panel frame for line edits. \value PE_FrameGroupBox Panel frame around group boxes. \value PE_FrameButtonBevel Panel frame for a button bevel. \value PE_FrameButtonTool Panel frame for a tool button.

\value PE_IndicatorHeaderArrow Arrow used to indicate sorting on a list or table header. \value PE_FrameStatusBarItem Frame for an item of a status bar; see also QStatusBar.

\value PE_FrameWindow Frame around a MDI window or a docking window.

\value PE_IndicatorMenuCheckMark Check mark used in a menu.

\value PE_IndicatorProgressChunk Section of a progress bar indicator; see also QProgressBar.

\value PE_IndicatorBranch Lines used to represent the branch of a tree in a tree view. \value PE_IndicatorToolBarHandle The handle of a toolbar. \value PE_IndicatorToolBarSeparator The separator in a toolbar. \value PE_PanelToolBar The panel for a toolbar. \value PE_PanelTipLabel The panel for a tip label. \value PE_FrameTabBarBase The frame that is drawn for a tab bar, usually drawn for a tab bar that isn't part of a tab widget. \value PE_IndicatorTabTear Deprecated. Use \l{PE_IndicatorTabTearLeft} instead. \value PE_IndicatorTabTearLeft An indicator that a tab is partially scrolled out on the left side of the visible tab bar when there are many tabs. \value PE_IndicatorTabTearRight An indicator that a tab is partially scrolled out on the right side of the visible tab bar when there are many tabs. \value PE_IndicatorColumnViewArrow An arrow in a QColumnView.

\value PE_Widget A plain QWidget.

\value PE_CustomBase Base value for custom primitive elements. All values above this are reserved for custom use. Custom values must be greater than this value.

\value PE_IndicatorItemViewItemDrop An indicator that is drawn to show where an item in an item view is about to be dropped during a drag-and-drop operation in an item view. \value PE_PanelItemViewItem The background for an item in an item view. \value PE_PanelItemViewRow The background of a row in an item view.

\value PE_PanelStatusBar The panel for a status bar.

\value PE_IndicatorTabClose The close button on a tab bar. \value PE_PanelMenu The panel for a menu.

See also
drawPrimitive()
Enumerator
PE_Frame 
PE_FrameDefaultButton 
PE_FrameDockWidget 
PE_FrameFocusRect 
PE_FrameGroupBox 
PE_FrameLineEdit 
PE_FrameMenu 
PE_FrameStatusBarItem 
PE_FrameTabWidget 
PE_FrameWindow 
PE_FrameButtonBevel 
PE_FrameButtonTool 
PE_FrameTabBarBase 
PE_PanelButtonCommand 
PE_PanelButtonBevel 
PE_PanelButtonTool 
PE_PanelMenuBar 
PE_PanelToolBar 
PE_PanelLineEdit 
PE_IndicatorArrowDown 
PE_IndicatorArrowLeft 
PE_IndicatorArrowRight 
PE_IndicatorArrowUp 
PE_IndicatorBranch 
PE_IndicatorButtonDropDown 
PE_IndicatorItemViewItemCheck 
PE_IndicatorCheckBox 
PE_IndicatorDockWidgetResizeHandle 
PE_IndicatorHeaderArrow 
PE_IndicatorMenuCheckMark 
PE_IndicatorProgressChunk 
PE_IndicatorRadioButton 
PE_IndicatorSpinDown 
PE_IndicatorSpinMinus 
PE_IndicatorSpinPlus 
PE_IndicatorSpinUp 
PE_IndicatorToolBarHandle 
PE_IndicatorToolBarSeparator 
PE_PanelTipLabel 
PE_IndicatorTabTear 
PE_IndicatorTabTearLeft 
PE_PanelScrollAreaCorner 
PE_Widget 
PE_IndicatorColumnViewArrow 
PE_IndicatorItemViewItemDrop 
PE_PanelItemViewItem 
PE_PanelItemViewRow 
PE_PanelStatusBar 
PE_IndicatorTabClose 
PE_PanelMenu 
PE_IndicatorTabTearRight 
PE_CustomBase 

Definition at line 102 of file qstyle.h.

◆ RequestSoftwareInputPanel

This enum describes under what circumstances a software input panel will be requested by input capable widgets.

\value RSIP_OnMouseClickAndAlreadyFocused Requests an input panel if the user clicks on the widget, but only if it is already focused. \value RSIP_OnMouseClick Requests an input panel if the user clicks on the widget.

See also
QInputMethod
Enumerator
RSIP_OnMouseClickAndAlreadyFocused 
RSIP_OnMouseClick 

Definition at line 578 of file qstyle.h.

◆ StandardPixmap

This enum describes the available standard pixmaps.

A standard pixmap is a pixmap that can follow some existing GUI style or guideline.

\value SP_TitleBarMinButton Minimize button on title bars (e.g., in QMdiSubWindow). \value SP_TitleBarMenuButton Menu button on a title bar. \value SP_TitleBarMaxButton Maximize button on title bars. \value SP_TitleBarCloseButton Close button on title bars. \value SP_TitleBarNormalButton Normal (restore) button on title bars. \value SP_TitleBarShadeButton Shade button on title bars. \value SP_TitleBarUnshadeButton Unshade button on title bars. \value SP_TitleBarContextHelpButton The Context help button on title bars. \value SP_MessageBoxInformation The "information" icon. \value SP_MessageBoxWarning The "warning" icon. \value SP_MessageBoxCritical The "critical" icon. \value SP_MessageBoxQuestion The "question" icon. \value SP_DesktopIcon The "desktop" icon. \value SP_TrashIcon The "trash" icon. \value SP_ComputerIcon The "My computer" icon. \value SP_DriveFDIcon The floppy icon. \value SP_DriveHDIcon The harddrive icon. \value SP_DriveCDIcon The CD icon. \value SP_DriveDVDIcon The DVD icon. \value SP_DriveNetIcon The network icon. \value SP_DirHomeIcon The home directory icon. \value SP_DirOpenIcon The open directory icon. \value SP_DirClosedIcon The closed directory icon. \value SP_DirIcon The directory icon. \value SP_DirLinkIcon The link to directory icon. \value SP_DirLinkOpenIcon The link to open directory icon. \value SP_FileIcon The file icon. \value SP_FileLinkIcon The link to file icon. \value SP_FileDialogStart The "start" icon in a file dialog. \value SP_FileDialogEnd The "end" icon in a file dialog. \value SP_FileDialogToParent The "parent directory" icon in a file dialog. \value SP_FileDialogNewFolder The "create new folder" icon in a file dialog. \value SP_FileDialogDetailedView The detailed view icon in a file dialog. \value SP_FileDialogInfoView The file info icon in a file dialog. \value SP_FileDialogContentsView The contents view icon in a file dialog. \value SP_FileDialogListView The list view icon in a file dialog. \value SP_FileDialogBack The back arrow in a file dialog. \value SP_DockWidgetCloseButton Close button on dock windows (see also QDockWidget). \value SP_ToolBarHorizontalExtensionButton Extension button for horizontal toolbars. \value SP_ToolBarVerticalExtensionButton Extension button for vertical toolbars. \value SP_DialogOkButton Icon for a standard OK button in a QDialogButtonBox. \value SP_DialogCancelButton Icon for a standard Cancel button in a QDialogButtonBox. \value SP_DialogHelpButton Icon for a standard Help button in a QDialogButtonBox. \value SP_DialogOpenButton Icon for a standard Open button in a QDialogButtonBox. \value SP_DialogSaveButton Icon for a standard Save button in a QDialogButtonBox. \value SP_DialogCloseButton Icon for a standard Close button in a QDialogButtonBox. \value SP_DialogApplyButton Icon for a standard Apply button in a QDialogButtonBox. \value SP_DialogResetButton Icon for a standard Reset button in a QDialogButtonBox. \value SP_DialogDiscardButton Icon for a standard Discard button in a QDialogButtonBox. \value SP_DialogYesButton Icon for a standard Yes button in a QDialogButtonBox. \value SP_DialogNoButton Icon for a standard No button in a QDialogButtonBox. \value SP_ArrowUp Icon arrow pointing up. \value SP_ArrowDown Icon arrow pointing down. \value SP_ArrowLeft Icon arrow pointing left. \value SP_ArrowRight Icon arrow pointing right. \value SP_ArrowBack Equivalent to SP_ArrowLeft when the current layout direction is Qt::LeftToRight, otherwise SP_ArrowRight. \value SP_ArrowForward Equivalent to SP_ArrowRight when the current layout direction is Qt::LeftToRight, otherwise SP_ArrowLeft. \value SP_CommandLink Icon used to indicate a Vista style command link glyph. \value SP_VistaShield Icon used to indicate UAC prompts on Windows Vista. This will return a null pixmap or icon on all other platforms. \value SP_BrowserReload Icon indicating that the current page should be reloaded. \value SP_BrowserStop Icon indicating that the page loading should stop. \value SP_MediaPlay Icon indicating that media should begin playback. \value SP_MediaStop Icon indicating that media should stop playback. \value SP_MediaPause Icon indicating that media should pause playback. \value SP_MediaSkipForward Icon indicating that media should skip forward. \value SP_MediaSkipBackward Icon indicating that media should skip backward. \value SP_MediaSeekForward Icon indicating that media should seek forward. \value SP_MediaSeekBackward Icon indicating that media should seek backward. \value SP_MediaVolume Icon indicating a volume control. \value SP_MediaVolumeMuted Icon indicating a muted volume control. \value [since 5.2] SP_LineEditClearButton Icon for a standard clear button in a QLineEdit. \value [since 5.14] SP_DialogYesToAllButton Icon for a standard YesToAll button in a QDialogButtonBox. \value [since 5.14] SP_DialogNoToAllButton Icon for a standard NoToAll button in a QDialogButtonBox. \value [since 5.14] SP_DialogSaveAllButton Icon for a standard SaveAll button in a QDialogButtonBox. \value [since 5.14] SP_DialogAbortButton Icon for a standard Abort button in a QDialogButtonBox. \value [since 5.14] SP_DialogRetryButton Icon for a standard Retry button in a QDialogButtonBox. \value [since 5.14] SP_DialogIgnoreButton Icon for a standard Ignore button in a QDialogButtonBox. \value [since 5.14] SP_RestoreDefaultsButton Icon for a standard RestoreDefaults button in a QDialogButtonBox. \value [since 6.3] SP_TabCloseButton Icon for the close button in the tab of a QTabBar. \omitvalue NStandardPixmap \value SP_CustomBase Base value for custom standard pixmaps; custom values must be greater than this value.

See also
standardIcon()
Enumerator
SP_TitleBarMenuButton 
SP_TitleBarMinButton 
SP_TitleBarMaxButton 
SP_TitleBarCloseButton 
SP_TitleBarNormalButton 
SP_TitleBarShadeButton 
SP_TitleBarUnshadeButton 
SP_TitleBarContextHelpButton 
SP_DockWidgetCloseButton 
SP_MessageBoxInformation 
SP_MessageBoxWarning 
SP_MessageBoxCritical 
SP_MessageBoxQuestion 
SP_DesktopIcon 
SP_TrashIcon 
SP_ComputerIcon 
SP_DriveFDIcon 
SP_DriveHDIcon 
SP_DriveCDIcon 
SP_DriveDVDIcon 
SP_DriveNetIcon 
SP_DirOpenIcon 
SP_DirClosedIcon 
SP_DirLinkIcon 
SP_DirLinkOpenIcon 
SP_FileIcon 
SP_FileLinkIcon 
SP_ToolBarHorizontalExtensionButton 
SP_ToolBarVerticalExtensionButton 
SP_FileDialogStart 
SP_FileDialogEnd 
SP_FileDialogToParent 
SP_FileDialogNewFolder 
SP_FileDialogDetailedView 
SP_FileDialogInfoView 
SP_FileDialogContentsView 
SP_FileDialogListView 
SP_FileDialogBack 
SP_DirIcon 
SP_DialogOkButton 
SP_DialogCancelButton 
SP_DialogHelpButton 
SP_DialogOpenButton 
SP_DialogSaveButton 
SP_DialogCloseButton 
SP_DialogApplyButton 
SP_DialogResetButton 
SP_DialogDiscardButton 
SP_DialogYesButton 
SP_DialogNoButton 
SP_ArrowUp 
SP_ArrowDown 
SP_ArrowLeft 
SP_ArrowRight 
SP_ArrowBack 
SP_ArrowForward 
SP_DirHomeIcon 
SP_CommandLink 
SP_VistaShield 
SP_BrowserReload 
SP_BrowserStop 
SP_MediaPlay 
SP_MediaStop 
SP_MediaPause 
SP_MediaSkipForward 
SP_MediaSkipBackward 
SP_MediaSeekForward 
SP_MediaSeekBackward 
SP_MediaVolume 
SP_MediaVolumeMuted 
SP_LineEditClearButton 
SP_DialogYesToAllButton 
SP_DialogNoToAllButton 
SP_DialogSaveAllButton 
SP_DialogAbortButton 
SP_DialogRetryButton 
SP_DialogIgnoreButton 
SP_RestoreDefaultsButton 
SP_TabCloseButton 
NStandardPixmap 
SP_CustomBase 

Definition at line 716 of file qstyle.h.

◆ StateFlag

This enum describes flags that are used when drawing primitive elements.

Note that not all primitives use all of these flags, and that the flags may mean different things to different items.

\value State_None Indicates that the widget does not have a state. \value State_Active Indicates that the widget is active. \value State_AutoRaise Used to indicate if auto-raise appearance should be used on a tool button. \value State_Children Used to indicate if an item view branch has children. \value State_DownArrow Used to indicate if a down arrow should be visible on the widget. \value State_Editing Used to indicate if an editor is opened on the widget. \value State_Enabled Used to indicate if the widget is enabled. \value State_HasEditFocus Used to indicate if the widget currently has edit focus. \value State_HasFocus Used to indicate if the widget has focus. \value State_Horizontal Used to indicate if the widget is laid out horizontally, for example. a tool bar. \value State_KeyboardFocusChange Used to indicate if the focus was changed with the keyboard, e.g., tab, backtab or shortcut. \value State_MouseOver Used to indicate if the widget is under the mouse. \value State_NoChange Used to indicate a tri-state checkbox. \value State_Off Used to indicate if the widget is not checked. \value State_On Used to indicate if the widget is checked. \value State_Raised Used to indicate if a button is raised. \value State_ReadOnly Used to indicate if a widget is read-only. \value State_Selected Used to indicate if a widget is selected. \value State_Item Used by item views to indicate if a horizontal branch should be drawn. \value State_Open Used by item views to indicate if the tree branch is open. \value State_Sibling Used by item views to indicate if a vertical line needs to be drawn (for siblings). \value State_Sunken Used to indicate if the widget is sunken or pressed. \value State_UpArrow Used to indicate if an up arrow should be visible on the widget. \value State_Mini Used to indicate a mini style Mac widget or button. \value State_Small Used to indicate a small style Mac widget or button. \omitvalue State_Window \omitvalue State_Bottom \omitvalue State_FocusAtBorder \omitvalue State_Top

See also
drawPrimitive()
Enumerator
State_None 
State_Enabled 
State_Raised 
State_Sunken 
State_Off 
State_NoChange 
State_On 
State_DownArrow 
State_Horizontal 
State_HasFocus 
State_Top 
State_Bottom 
State_FocusAtBorder 
State_AutoRaise 
State_MouseOver 
State_UpArrow 
State_Selected 
State_Active 
State_Window 
State_Open 
State_Children 
State_Item 
State_Sibling 
State_Editing 
State_KeyboardFocusChange 
State_ReadOnly 
State_Small 
State_Mini 

Definition at line 65 of file qstyle.h.

◆ StyleHint

This enum describes the available style hints.

A style hint is a general look and/or feel hint.

\value SH_EtchDisabledText Disabled text is "etched" as it is on Windows.

\value SH_DitherDisabledText Disabled text is dithered as it is on Motif.

\value SH_ScrollBar_ContextMenu Whether or not a scroll bar has a context menu.

\value SH_ScrollBar_MiddleClickAbsolutePosition A boolean value. If true, middle clicking on a scroll bar causes the slider to jump to that position. If false, middle clicking is ignored.

\value SH_ScrollBar_LeftClickAbsolutePosition A boolean value. If true, left clicking on a scroll bar causes the slider to jump to that position. If false, left clicking will behave as appropriate for each control.

\value SH_ScrollBar_ScrollWhenPointerLeavesControl A boolean value. If true, when clicking a scroll bar SubControl, holding the mouse button down and moving the pointer outside the SubControl, the scroll bar continues to scroll. If false, the scollbar stops scrolling when the pointer leaves the SubControl.

\value SH_ScrollBar_RollBetweenButtons A boolean value. If true, when clicking a scroll bar button (SC_ScrollBarAddLine or SC_ScrollBarSubLine) and dragging over to the opposite button (rolling) will press the new button and release the old one. When it is false, the original button is released and nothing happens (like a push button).

\value SH_TabBar_Alignment The alignment for tabs in a QTabWidget. Possible values are Qt::AlignLeft, Qt::AlignCenter and Qt::AlignRight.

\value SH_Header_ArrowAlignment The placement of the sorting indicator may appear in list or table headers. Possible values are Qt::Alignment values (that is, an OR combination of Qt::AlignmentFlag flags).

\value SH_Slider_SnapToValue Sliders snap to values while moving, as they do on Windows.

\value SH_Slider_SloppyKeyEvents Key presses handled in a sloppy manner, i.e., left on a vertical slider subtracts a line.

\value SH_ProgressDialog_CenterCancelButton Center button on progress dialogs, otherwise right aligned.

\value SH_ProgressDialog_TextLabelAlignment The alignment for text labels in progress dialogs; Qt::AlignCenter on Windows, Qt::AlignVCenter otherwise.

\value SH_PrintDialog_RightAlignButtons Right align buttons in the print dialog, as done on Windows.

\value SH_MainWindow_SpaceBelowMenuBar One or two pixel space between the menu bar and the dockarea, as done on Windows.

\value SH_FontDialog_SelectAssociatedText Select the text in the line edit, or when selecting an item from the listbox, or when the line edit receives focus, as done on Windows.

\value SH_Menu_KeyboardSearch Typing causes a menu to be search for relevant items, otherwise only mnemonic is considered.

\value SH_Menu_AllowActiveAndDisabled Allows disabled menu items to be active.

\value SH_Menu_SpaceActivatesItem Pressing the space bar activates the item, as done on Motif.

\value SH_Menu_SubMenuPopupDelay The number of milliseconds to wait before opening a submenu (256 on Windows, 96 on Motif).

\value SH_Menu_Scrollable Whether popup menus must support scrolling.

\value SH_Menu_SloppySubMenus Whether popup menus must support the user moving the mouse cursor to a submenu while crossing other items of the menu. This is supported on most modern desktop platforms.

\value SH_Menu_SubMenuUniDirection Since Qt 5.5. If the cursor has to move towards the submenu (like it is on \macos), or if the cursor can move in any direction as long as it reaches the submenu before the sloppy timeout.

\value SH_Menu_SubMenuUniDirectionFailCount Since Qt 5.5. When SH_Menu_SubMenuUniDirection is defined this enum defines the number of failed mouse moves before the sloppy submenu is discarded. This can be used to control the "strictness" of the uni direction algorithm.

\value SH_Menu_SubMenuSloppySelectOtherActions Since Qt 5.5. Should other action items be selected when the mouse moves towards a sloppy submenu.

\value SH_Menu_SubMenuSloppyCloseTimeout Since Qt 5.5. The timeout used to close sloppy submenus.

\value SH_Menu_SubMenuResetWhenReenteringParent Since Qt 5.5. When entering parent from child submenu, should the sloppy state be reset, effectively closing the child and making the current submenu active.

\value SH_Menu_SubMenuDontStartSloppyOnLeave Since Qt 5.5. Do not start sloppy timers when the mouse leaves a sub-menu.

\value SH_ScrollView_FrameOnlyAroundContents Whether scrollviews draw their frame only around contents (like Motif), or around contents, scroll bars and corner widgets (like Windows).

\value SH_MenuBar_AltKeyNavigation Menu bars items are navigable by pressing Alt, followed by using the arrow keys to select the desired item.

\value SH_ComboBox_ListMouseTracking Mouse tracking in combobox drop-down lists.

\value SH_Menu_MouseTracking Mouse tracking in popup menus.

\value SH_MenuBar_MouseTracking Mouse tracking in menu bars.

\value SH_Menu_FillScreenWithScroll Whether scrolling popups should fill the screen as they are scrolled.

\value SH_Menu_SelectionWrap Whether popups should allow the selections to wrap, that is when selection should the next item be the first item.

\value SH_ItemView_ChangeHighlightOnFocus Gray out selected items when losing focus.

\value SH_Widget_ShareActivation Turn on sharing activation with floating modeless dialogs.

\value SH_TabBar_SelectMouseType Which type of mouse event should cause a tab to be selected.

\value SH_ListViewExpand_SelectMouseType Which type of mouse event should cause a list view expansion to be selected.

\value SH_TabBar_PreferNoArrows Whether a tab bar should suggest a size to prevent scroll arrows.

\value SH_ComboBox_Popup Allows popups as a combobox drop-down menu.

\omitvalue SH_ComboBox_UseNativePopup

\value SH_Workspace_FillSpaceOnMaximize The workspace should maximize the client area.

\value SH_TitleBar_NoBorder The title bar has no border.

\value SH_Slider_StopMouseOverSlider Stops auto-repeat when the slider reaches the mouse position.

\value SH_BlinkCursorWhenTextSelected Whether cursor should blink when text is selected.

\value SH_RichText_FullWidthSelection Whether richtext selections should extend to the full width of the document.

\value SH_GroupBox_TextLabelVerticalAlignment How to vertically align a group box's text label.

\value SH_GroupBox_TextLabelColor How to paint a group box's text label.

\value SH_DialogButtons_DefaultButton Which button gets the default status in a dialog's button widget.

\value SH_ToolBox_SelectedPageTitleBold Boldness of the selected page title in a QToolBox.

\value SH_LineEdit_PasswordCharacter The Unicode character to be used for passwords.

\value SH_LineEdit_PasswordMaskDelay Determines the delay before visible character is masked with password character, in milliseconds. This enum value was added in Qt 5.4.

\value SH_Table_GridLineColor The RGBA value of the grid for a table.

\value SH_UnderlineShortcut Whether shortcuts are underlined.

\value SH_SpinBox_AnimateButton Animate a click when up or down is pressed in a spin box. \value SH_SpinBox_KeyPressAutoRepeatRate Auto-repeat interval for spinbox key presses. \value SH_SpinBox_ClickAutoRepeatRate Auto-repeat interval for spinbox mouse clicks. \value SH_SpinBox_ClickAutoRepeatThreshold Auto-repeat threshold for spinbox mouse clicks. \value [since 6.3] SH_SpinBox_SelectOnStep Whether changing the value using the buttons or up/down keys automatically selects the text.

\value SH_ToolTipLabel_Opacity An integer indicating the opacity for the tip label, 0 is completely transparent, 255 is completely opaque. \value SH_DrawMenuBarSeparator Indicates whether or not the menu bar draws separators. \value SH_TitleBar_ModifyNotification Indicates if the title bar should show a '*' for windows that are modified.

\value SH_Button_FocusPolicy The default focus policy for buttons.

\value SH_CustomBase Base value for custom style hints. Custom values must be greater than this value.

\value SH_MessageBox_UseBorderForButtonSpacing A boolean indicating what the to use the border of the buttons (computed as half the button height) for the spacing of the button in a message box.

\value SH_MessageBox_CenterButtons A boolean indicating whether the buttons in the message box should be centered or not (see QDialogButtonBox::setCentered()).

\value SH_MessageBox_TextInteractionFlags A boolean indicating if the text in a message box should allow user interactions (e.g. selection) or not.

\value SH_TitleBar_AutoRaise A boolean indicating whether controls on a title bar ought to update when the mouse is over them.

\value SH_ToolButton_PopupDelay An int indicating the popup delay in milliseconds for menus attached to tool buttons.

\value SH_FocusFrame_Mask The mask of the focus frame.

\value SH_RubberBand_Mask The mask of the rubber band.

\value SH_WindowFrame_Mask The mask of the window frame.

\value SH_SpinControls_DisableOnBounds Determines if the spin controls will shown as disabled when reaching the spin range boundary.

\value SH_Dial_BackgroundRole Defines the style's preferred background role (as QPalette::ColorRole) for a dial widget.

\value SH_ComboBox_LayoutDirection The layout direction for the combo box. By default it should be the same as indicated by the QStyleOption::direction variable.

\value SH_ItemView_EllipsisLocation The location where ellipses should be added for item text that is too long to fit in an view item.

\value SH_ItemView_ShowDecorationSelected When an item in an item view is selected, also highlight the branch or other decoration.

\value SH_ItemView_ActivateItemOnSingleClick Emit the activated signal when the user single clicks on an item in an item in an item view. Otherwise the signal is emitted when the user double clicks on an item.

\value SH_Slider_AbsoluteSetButtons Which mouse buttons cause a slider to set the value to the position clicked on.

\value SH_Slider_PageSetButtons Which mouse buttons cause a slider to page step the value.

\value SH_TabBar_ElideMode The default eliding style for a tab bar.

\value SH_DialogButtonLayout Controls how buttons are laid out in a QDialogButtonBox, returns a QDialogButtonBox::ButtonLayout enum.

\value SH_WizardStyle Controls the look and feel of a QWizard. Returns a QWizard::WizardStyle enum.

\value SH_FormLayoutWrapPolicy Provides a default for how rows are wrapped in a QFormLayout. Returns a QFormLayout::RowWrapPolicy enum. \value SH_FormLayoutFieldGrowthPolicy Provides a default for how fields can grow in a QFormLayout. Returns a QFormLayout::FieldGrowthPolicy enum. \value SH_FormLayoutFormAlignment Provides a default for how a QFormLayout aligns its contents within the available space. Returns a Qt::Alignment enum. \value SH_FormLayoutLabelAlignment Provides a default for how a QFormLayout aligns labels within the available space. Returns a Qt::Alignment enum.

\value SH_ItemView_ArrowKeysNavigateIntoChildren Controls whether the tree view will select the first child when it is exapanded and the right arrow key is pressed. \value SH_ComboBox_PopupFrameStyle The frame style used when drawing a combobox popup menu.

\value SH_DialogButtonBox_ButtonsHaveIcons Indicates whether or not StandardButtons in QDialogButtonBox should have icons or not. \value SH_ItemView_MovementWithoutUpdatingSelection The item view is able to indicate a current item without changing the selection. \value SH_ToolTip_Mask The mask of a tool tip.

\value SH_FocusFrame_AboveWidget The FocusFrame is stacked above the widget that it is "focusing on".

\value SH_TextControl_FocusIndicatorTextCharFormat Specifies the text format used to highlight focused anchors in rich text documents displayed for example in QTextBrowser. The format has to be a QTextCharFormat returned in the variant of the QStyleHintReturnVariant return value. The QTextFormat::OutlinePen property is used for the outline and QTextFormat::BackgroundBrush for the background of the highlighted area.

\value SH_Menu_FlashTriggeredItem Flash triggered item. \value SH_Menu_FadeOutOnHide Fade out the menu instead of hiding it immediately.

\value SH_TabWidget_DefaultTabPosition Default position of the tab bar in a tab widget.

\value SH_ToolBar_Movable Determines if the tool bar is movable by default.

\value SH_ItemView_PaintAlternatingRowColorsForEmptyArea Whether QTreeView paints alternating row colors for the area that does not have any items.

\value SH_Menu_Mask The mask for a popup menu.

\value SH_ItemView_DrawDelegateFrame Determines if there should be a frame for a delegate widget.

\value SH_TabBar_CloseButtonPosition Determines the position of the close button on a tab in a tab bar.

\value SH_DockWidget_ButtonsHaveFrame Determines if dockwidget buttons should have frames. Default is true.

\value SH_ToolButtonStyle Determines the default system style for tool buttons that uses Qt::ToolButtonFollowStyle.

\value SH_RequestSoftwareInputPanel Determines when a software input panel should be requested by input widgets. Returns an enum of type QStyle::RequestSoftwareInputPanel.

\value SH_ScrollBar_Transient Determines if the style supports transient scroll bars. Transient scroll bars appear when the content is scrolled and disappear when they are no longer needed.

\value SH_Menu_SupportsSections Determines if the style displays sections in menus or treat them as plain separators. Sections are separators with a text and icon hint.

\value SH_ToolTip_WakeUpDelay Determines the delay before a tooltip is shown, in milliseconds.

\value SH_ToolTip_FallAsleepDelay Determines the delay (in milliseconds) before a new wake time is needed when a tooltip is shown (notice: shown, not hidden). When a new wake isn't needed, a user-requested tooltip will be shown nearly instantly.

\value SH_Widget_Animate Deprecated. Use \l{SH_Widget_Animation_Duration} instead.

\value SH_Splitter_OpaqueResize Determines if widgets are resized dynamically (opaquely) while interactively moving the splitter. This enum value was introduced in Qt 5.2.

\value SH_TabBar_ChangeCurrentDelay Determines the delay before the current tab is changed while dragging over the tabbar, in milliseconds. This enum value has been introduced in Qt 5.4

\value SH_ItemView_ScrollMode The default vertical and horizontal scroll mode as specified by the style. Can be overridden with QAbstractItemView::setVerticalScrollMode() and QAbstractItemView::setHorizontalScrollMode(). This enum value has been introduced in Qt 5.7.

\value SH_TitleBar_ShowToolTipsOnButtons Determines if tool tips are shown on window title bar buttons. The Mac style, for example, sets this to false. This enum value has been introduced in Qt 5.10.

\value SH_Widget_Animation_Duration Determines how much an animation should last (in ms). A value equal to zero means that the animations will be disabled. This enum value has been introduced in Qt 5.10.

\value SH_ComboBox_AllowWheelScrolling Determines if the mouse wheel can be used to scroll inside a QComboBox. This is on by default in all styles except the Mac style. This enum value has been introduced in Qt 5.10.

\value SH_SpinBox_ButtonsInsideFrame Determines if the spin box buttons are inside the line edit frame. This enum value has been introduced in Qt 5.11.

\value SH_SpinBox_StepModifier Determines which Qt::KeyboardModifier increases the step rate of QAbstractSpinBox. Possible values are Qt::NoModifier, Qt::ControlModifier (default) or Qt::ShiftModifier. Qt::NoModifier disables this feature. This enum value has been introduced in Qt 5.12.

\value SH_TabBar_AllowWheelScrolling Determines if the mouse wheel can be used to cycle through the tabs of a QTabBar. This enum value has been introduced in Qt 6.1.

\value SH_Table_AlwaysDrawLeftTopGridLines Determines if the far left and top grid lines are drawn in a table or not when the header is hidden. Defaults to false. This enum value has been introduced in Qt 6.3.

See also
styleHint()
Enumerator
SH_EtchDisabledText 
SH_DitherDisabledText 
SH_ScrollBar_MiddleClickAbsolutePosition 
SH_ScrollBar_ScrollWhenPointerLeavesControl 
SH_TabBar_SelectMouseType 
SH_TabBar_Alignment 
SH_Header_ArrowAlignment 
SH_Slider_SnapToValue 
SH_Slider_SloppyKeyEvents 
SH_ProgressDialog_CenterCancelButton 
SH_ProgressDialog_TextLabelAlignment 
SH_PrintDialog_RightAlignButtons 
SH_MainWindow_SpaceBelowMenuBar 
SH_FontDialog_SelectAssociatedText 
SH_Menu_AllowActiveAndDisabled 
SH_Menu_SpaceActivatesItem 
SH_Menu_SubMenuPopupDelay 
SH_ScrollView_FrameOnlyAroundContents 
SH_MenuBar_AltKeyNavigation 
SH_ComboBox_ListMouseTracking 
SH_Menu_MouseTracking 
SH_MenuBar_MouseTracking 
SH_ItemView_ChangeHighlightOnFocus 
SH_Widget_ShareActivation 
SH_Workspace_FillSpaceOnMaximize 
SH_ComboBox_Popup 
SH_TitleBar_NoBorder 
SH_Slider_StopMouseOverSlider 
SH_BlinkCursorWhenTextSelected 
SH_RichText_FullWidthSelection 
SH_Menu_Scrollable 
SH_GroupBox_TextLabelVerticalAlignment 
SH_GroupBox_TextLabelColor 
SH_Menu_SloppySubMenus 
SH_Table_GridLineColor 
SH_LineEdit_PasswordCharacter 
SH_DialogButtons_DefaultButton 
SH_ToolBox_SelectedPageTitleBold 
SH_TabBar_PreferNoArrows 
SH_ScrollBar_LeftClickAbsolutePosition 
SH_ListViewExpand_SelectMouseType 
SH_UnderlineShortcut 
SH_SpinBox_AnimateButton 
SH_SpinBox_KeyPressAutoRepeatRate 
SH_SpinBox_ClickAutoRepeatRate 
SH_Menu_FillScreenWithScroll 
SH_ToolTipLabel_Opacity 
SH_DrawMenuBarSeparator 
SH_TitleBar_ModifyNotification 
SH_Button_FocusPolicy 
SH_MessageBox_UseBorderForButtonSpacing 
SH_TitleBar_AutoRaise 
SH_ToolButton_PopupDelay 
SH_FocusFrame_Mask 
SH_RubberBand_Mask 
SH_WindowFrame_Mask 
SH_SpinControls_DisableOnBounds 
SH_Dial_BackgroundRole 
SH_ComboBox_LayoutDirection 
SH_ItemView_EllipsisLocation 
SH_ItemView_ShowDecorationSelected 
SH_ItemView_ActivateItemOnSingleClick 
SH_ScrollBar_ContextMenu 
SH_ScrollBar_RollBetweenButtons 
SH_Slider_AbsoluteSetButtons 
SH_Slider_PageSetButtons 
SH_Menu_KeyboardSearch 
SH_TabBar_ElideMode 
SH_DialogButtonLayout 
SH_ComboBox_PopupFrameStyle 
SH_MessageBox_TextInteractionFlags 
SH_DialogButtonBox_ButtonsHaveIcons 
SH_MessageBox_CenterButtons 
SH_Menu_SelectionWrap 
SH_ItemView_MovementWithoutUpdatingSelection 
SH_ToolTip_Mask 
SH_FocusFrame_AboveWidget 
SH_TextControl_FocusIndicatorTextCharFormat 
SH_WizardStyle 
SH_ItemView_ArrowKeysNavigateIntoChildren 
SH_Menu_Mask 
SH_Menu_FlashTriggeredItem 
SH_Menu_FadeOutOnHide 
SH_SpinBox_ClickAutoRepeatThreshold 
SH_ItemView_PaintAlternatingRowColorsForEmptyArea 
SH_FormLayoutWrapPolicy 
SH_TabWidget_DefaultTabPosition 
SH_ToolBar_Movable 
SH_FormLayoutFieldGrowthPolicy 
SH_FormLayoutFormAlignment 
SH_FormLayoutLabelAlignment 
SH_ItemView_DrawDelegateFrame 
SH_TabBar_CloseButtonPosition 
SH_DockWidget_ButtonsHaveFrame 
SH_ToolButtonStyle 
SH_RequestSoftwareInputPanel 
SH_ScrollBar_Transient 
SH_Menu_SupportsSections 
SH_ToolTip_WakeUpDelay 
SH_ToolTip_FallAsleepDelay 
SH_Widget_Animate 
SH_Splitter_OpaqueResize 
SH_ComboBox_UseNativePopup 
SH_LineEdit_PasswordMaskDelay 
SH_TabBar_ChangeCurrentDelay 
SH_Menu_SubMenuUniDirection 
SH_Menu_SubMenuUniDirectionFailCount 
SH_Menu_SubMenuSloppySelectOtherActions 
SH_Menu_SubMenuSloppyCloseTimeout 
SH_Menu_SubMenuResetWhenReenteringParent 
SH_Menu_SubMenuDontStartSloppyOnLeave 
SH_ItemView_ScrollMode 
SH_TitleBar_ShowToolTipsOnButtons 
SH_Widget_Animation_Duration 
SH_ComboBox_AllowWheelScrolling 
SH_SpinBox_ButtonsInsideFrame 
SH_SpinBox_StepModifier 
SH_TabBar_AllowWheelScrolling 
SH_Table_AlwaysDrawLeftTopGridLines 
SH_SpinBox_SelectOnStep 
SH_CustomBase 

Definition at line 584 of file qstyle.h.

◆ SubControl

This enum describes the available sub controls.

A subcontrol is a control element within a complex control (ComplexControl).

\value SC_None Special value that matches no other sub control.

\value SC_ScrollBarAddLine Scroll bar add line (i.e., down/right arrow); see also QScrollBar. \value SC_ScrollBarSubLine Scroll bar sub line (i.e., up/left arrow). \value SC_ScrollBarAddPage Scroll bar add page (i.e., page down). \value SC_ScrollBarSubPage Scroll bar sub page (i.e., page up). \value SC_ScrollBarFirst Scroll bar first line (i.e., home). \value SC_ScrollBarLast Scroll bar last line (i.e., end). \value SC_ScrollBarSlider Scroll bar slider handle. \value SC_ScrollBarGroove Special sub-control which contains the area in which the slider handle may move.

\value SC_SpinBoxUp Spin widget up/increase; see also QSpinBox. \value SC_SpinBoxDown Spin widget down/decrease. \value SC_SpinBoxFrame Spin widget frame. \value SC_SpinBoxEditField Spin widget edit field.

\value SC_ComboBoxEditField Combobox edit field; see also QComboBox. \value SC_ComboBoxArrow Combobox arrow button. \value SC_ComboBoxFrame Combobox frame. \value SC_ComboBoxListBoxPopup The reference rectangle for the combobox popup. Used to calculate the position of the popup.

\value SC_SliderGroove Special sub-control which contains the area in which the slider handle may move. \value SC_SliderHandle Slider handle. \value SC_SliderTickmarks Slider tickmarks.

\value SC_ToolButton Tool button (see also QToolButton). \value SC_ToolButtonMenu Sub-control for opening a popup menu in a tool button.

\value SC_TitleBarSysMenu System menu button (i.e., restore, close, etc.). \value SC_TitleBarMinButton Minimize button. \value SC_TitleBarMaxButton Maximize button. \value SC_TitleBarCloseButton Close button. \value SC_TitleBarLabel Window title label. \value SC_TitleBarNormalButton Normal (restore) button. \value SC_TitleBarShadeButton Shade button. \value SC_TitleBarUnshadeButton Unshade button. \value SC_TitleBarContextHelpButton Context Help button.

\value SC_DialHandle The handle of the dial (i.e. what you use to control the dial). \value SC_DialGroove The groove for the dial. \value SC_DialTickmarks The tickmarks for the dial.

\value SC_GroupBoxFrame The frame of a group box. \value SC_GroupBoxLabel The title of a group box. \value SC_GroupBoxCheckBox The optional check box of a group box. \value SC_GroupBoxContents The group box contents.

\value SC_MdiNormalButton The normal button for a MDI subwindow in the menu bar. \value SC_MdiMinButton The minimize button for a MDI subwindow in the menu bar. \value SC_MdiCloseButton The close button for a MDI subwindow in the menu bar.

\value SC_All Special value that matches all sub-controls. \omitvalue SC_CustomBase

See also
ComplexControl
Enumerator
SC_None 
SC_ScrollBarAddLine 
SC_ScrollBarSubLine 
SC_ScrollBarAddPage 
SC_ScrollBarSubPage 
SC_ScrollBarFirst 
SC_ScrollBarLast 
SC_ScrollBarSlider 
SC_ScrollBarGroove 
SC_SpinBoxUp 
SC_SpinBoxDown 
SC_SpinBoxFrame 
SC_SpinBoxEditField 
SC_ComboBoxFrame 
SC_ComboBoxEditField 
SC_ComboBoxArrow 
SC_ComboBoxListBoxPopup 
SC_SliderGroove 
SC_SliderHandle 
SC_SliderTickmarks 
SC_ToolButton 
SC_ToolButtonMenu 
SC_TitleBarSysMenu 
SC_TitleBarMinButton 
SC_TitleBarMaxButton 
SC_TitleBarCloseButton 
SC_TitleBarNormalButton 
SC_TitleBarShadeButton 
SC_TitleBarUnshadeButton 
SC_TitleBarContextHelpButton 
SC_TitleBarLabel 
SC_DialGroove 
SC_DialHandle 
SC_DialTickmarks 
SC_GroupBoxCheckBox 
SC_GroupBoxLabel 
SC_GroupBoxContents 
SC_GroupBoxFrame 
SC_MdiMinButton 
SC_MdiNormalButton 
SC_MdiCloseButton 
SC_CustomBase 
SC_All 

Definition at line 347 of file qstyle.h.

◆ SubElement

This enum represents a sub-area of a widget.

Style implementations use these areas to draw the different parts of a widget.

\value SE_PushButtonContents Area containing the label (icon with text or pixmap). \value SE_PushButtonFocusRect Area for the focus rect (usually larger than the contents rect). \value SE_PushButtonLayoutItem Area that counts for the parent layout. \value SE_PushButtonBevel [since 5.15] Area used for the bevel of the button.

\value SE_CheckBoxIndicator Area for the state indicator (e.g., check mark). \value SE_CheckBoxContents Area for the label (text or pixmap). \value SE_CheckBoxFocusRect Area for the focus indicator. \value SE_CheckBoxClickRect Clickable area, defaults to SE_CheckBoxFocusRect. \value SE_CheckBoxLayoutItem Area that counts for the parent layout.

\value SE_DateTimeEditLayoutItem Area that counts for the parent layout.

\value SE_RadioButtonIndicator Area for the state indicator. \value SE_RadioButtonContents Area for the label. \value SE_RadioButtonFocusRect Area for the focus indicator. \value SE_RadioButtonClickRect Clickable area, defaults to SE_RadioButtonFocusRect. \value SE_RadioButtonLayoutItem Area that counts for the parent layout.

\value SE_ComboBoxFocusRect Area for the focus indicator.

\value SE_SliderFocusRect Area for the focus indicator. \value SE_SliderLayoutItem Area that counts for the parent layout.

\value SE_SpinBoxLayoutItem Area that counts for the parent layout.

\value SE_ProgressBarGroove Area for the groove. \value SE_ProgressBarContents Area for the progress indicator. \value SE_ProgressBarLabel Area for the text label. \value SE_ProgressBarLayoutItem Area that counts for the parent layout.

\value SE_FrameContents Area for a frame's contents. \value SE_ShapedFrameContents Area for a frame's contents using the shape in QStyleOptionFrame; see QFrame \value SE_FrameLayoutItem Area that counts for the parent layout.

\value SE_HeaderArrow Area for the sort indicator for a header. \value SE_HeaderLabel Area for the label in a header.

\value SE_LabelLayoutItem Area that counts for the parent layout.

\value SE_LineEditContents Area for a line edit's contents.

\value SE_TabWidgetLeftCorner Area for the left corner widget in a tab widget. \value SE_TabWidgetRightCorner Area for the right corner widget in a tab widget. \value SE_TabWidgetTabBar Area for the tab bar widget in a tab widget. \value SE_TabWidgetTabContents Area for the contents of the tab widget. \value SE_TabWidgetTabPane Area for the pane of a tab widget. \value SE_TabWidgetLayoutItem Area that counts for the parent layout.

\value SE_ToolBoxTabContents Area for a toolbox tab's icon and label.

\value SE_ToolButtonLayoutItem Area that counts for the parent layout.

\value SE_ItemViewItemCheckIndicator Area for a view item's check mark.

\value SE_TabBarTearIndicator Deprecated. Use SE_TabBarTearIndicatorLeft instead. \value SE_TabBarTearIndicatorLeft Area for the tear indicator on the left side of a tab bar with scroll arrows. \value SE_TabBarTearIndicatorRight Area for the tear indicator on the right side of a tab bar with scroll arrows.

\value SE_TabBarScrollLeftButton Area for the scroll left button on a tab bar with scroll buttons. \value SE_TabBarScrollRightButton Area for the scroll right button on a tab bar with scroll buttons.

\value SE_TreeViewDisclosureItem Area for the actual disclosure item in a tree branch.

\value SE_GroupBoxLayoutItem Area that counts for the parent layout.

\value SE_CustomBase Base value for custom sub-elements. Custom values must be greater than this value.

\value SE_DockWidgetFloatButton The float button of a dock widget. \value SE_DockWidgetTitleBarText The text bounds of the dock widgets title. \value SE_DockWidgetCloseButton The close button of a dock widget. \value SE_DockWidgetIcon The icon of a dock widget. \value SE_ComboBoxLayoutItem Area that counts for the parent layout.

\value SE_ItemViewItemDecoration Area for a view item's decoration (icon). \value SE_ItemViewItemText Area for a view item's text. \value SE_ItemViewItemFocusRect Area for a view item's focus rect.

\value SE_TabBarTabLeftButton Area for a widget on the left side of a tab in a tab bar. \value SE_TabBarTabRightButton Area for a widget on the right side of a tab in a tab bar. \value SE_TabBarTabText Area for the text on a tab in a tab bar.

\value SE_ToolBarHandle Area for the handle of a tool bar.

See also
subElementRect()
Enumerator
SE_PushButtonContents 
SE_PushButtonFocusRect 
SE_CheckBoxIndicator 
SE_CheckBoxContents 
SE_CheckBoxFocusRect 
SE_CheckBoxClickRect 
SE_RadioButtonIndicator 
SE_RadioButtonContents 
SE_RadioButtonFocusRect 
SE_RadioButtonClickRect 
SE_ComboBoxFocusRect 
SE_SliderFocusRect 
SE_ProgressBarGroove 
SE_ProgressBarContents 
SE_ProgressBarLabel 
SE_ToolBoxTabContents 
SE_HeaderLabel 
SE_HeaderArrow 
SE_TabWidgetTabBar 
SE_TabWidgetTabPane 
SE_TabWidgetTabContents 
SE_TabWidgetLeftCorner 
SE_TabWidgetRightCorner 
SE_ItemViewItemCheckIndicator 
SE_TabBarTearIndicator 
SE_TabBarTearIndicatorLeft 
SE_TreeViewDisclosureItem 
SE_LineEditContents 
SE_FrameContents 
SE_DockWidgetCloseButton 
SE_DockWidgetFloatButton 
SE_DockWidgetTitleBarText 
SE_DockWidgetIcon 
SE_CheckBoxLayoutItem 
SE_ComboBoxLayoutItem 
SE_DateTimeEditLayoutItem 
SE_LabelLayoutItem 
SE_ProgressBarLayoutItem 
SE_PushButtonLayoutItem 
SE_RadioButtonLayoutItem 
SE_SliderLayoutItem 
SE_SpinBoxLayoutItem 
SE_ToolButtonLayoutItem 
SE_FrameLayoutItem 
SE_GroupBoxLayoutItem 
SE_TabWidgetLayoutItem 
SE_ItemViewItemDecoration 
SE_ItemViewItemText 
SE_ItemViewItemFocusRect 
SE_TabBarTabLeftButton 
SE_TabBarTabRightButton 
SE_TabBarTabText 
SE_ShapedFrameContents 
SE_ToolBarHandle 
SE_TabBarScrollLeftButton 
SE_TabBarScrollRightButton 
SE_TabBarTearIndicatorRight 
SE_PushButtonBevel 
SE_CustomBase 

Definition at line 242 of file qstyle.h.

Constructor & Destructor Documentation

◆ QStyle() [1/2]

QStyle::QStyle ( QStylePrivate & dd)
protected

Constructs a style object.

Definition at line 372 of file qstyle.cpp.

◆ QStyle() [2/2]

QStyle::QStyle ( )

Constructs a style object.

Definition at line 360 of file qstyle.cpp.

◆ ~QStyle()

QStyle::~QStyle ( )
virtual

Destroys the style object.

Definition at line 385 of file qstyle.cpp.

Member Function Documentation

◆ alignedRect()

QRect QStyle::alignedRect ( Qt::LayoutDirection direction,
Qt::Alignment alignment,
const QSize & size,
const QRect & rectangle )
static

Returns a new rectangle of the specified size that is aligned to the given rectangle according to the specified alignment and direction.

Definition at line 2174 of file qstyle.cpp.

◆ combinedLayoutSpacing()

int QStyle::combinedLayoutSpacing ( QSizePolicy::ControlTypes controls1,
QSizePolicy::ControlTypes controls2,
Qt::Orientation orientation,
QStyleOption * option = nullptr,
QWidget * widget = nullptr ) const
Since
4.3

Returns the spacing that should be used between controls1 and controls2 in a layout. orientation specifies whether the controls are laid out side by side or stacked vertically. The option parameter can be used to pass extra information about the parent widget. The widget parameter is optional and can also be used if option is \nullptr.

controls1 and controls2 are OR-combination of zero or more \l{QSizePolicy::ControlTypes}{control types}.

This function is called by the layout system. It is used only if PM_LayoutHorizontalSpacing or PM_LayoutVerticalSpacing returns a negative value.

See also
layoutSpacing()

Definition at line 2372 of file qstyle.cpp.

◆ drawComplexControl()

virtual void QStyle::drawComplexControl ( ComplexControl control,
const QStyleOptionComplex * option,
QPainter * painter,
const QWidget * widget = nullptr ) const
pure virtual

Draws the given control using the provided painter with the style options specified by option.

The widget argument is optional and can be used as aid in drawing the control.

The option parameter is a pointer to a QStyleOptionComplex object that can be cast to the correct subclass using the qstyleoption_cast() function. Note that the rect member of the specified option must be in logical coordinates. Reimplementations of this function should use visualRect() to change the logical coordinates into screen coordinates before calling the drawPrimitive() or drawControl() function.

The table below is listing the complex control elements and their associated style option subclass. The style options contain all the parameters required to draw the controls, including QStyleOption::state which holds the \l {QStyle::StateFlag}{style flags} that are used when drawing. The table also describes which flags that are set when casting the given option to the appropriate subclass.

\table \header

  • Complex Control
  • QStyleOptionComplex Subclass
  • Style Flag
  • Remark \row
  • {1,2} \l{CC_SpinBox}
  • {1,2} \l QStyleOptionSpinBox
  • \l State_Enabled
  • Set if the spin box is enabled. \row
  • \l State_HasFocus
  • Set if the spin box has input focus.

\row

  • {1,2} \l {CC_ComboBox}
  • {1,2} \l QStyleOptionComboBox
  • \l State_Enabled
  • Set if the combobox is enabled. \row
  • \l State_HasFocus
  • Set if the combobox has input focus.

\row

  • {1,2} \l {CC_ScrollBar}
  • {1,2} \l QStyleOptionSlider
  • \l State_Enabled
  • Set if the scroll bar is enabled. \row
  • \l State_HasFocus
  • Set if the scroll bar has input focus.

\row

  • {1,2} \l {CC_Slider}
  • {1,2} \l QStyleOptionSlider
  • \l State_Enabled
  • Set if the slider is enabled. \row
  • \l State_HasFocus
  • Set if the slider has input focus.

\row

  • {1,2} \l {CC_Dial}
  • {1,2} \l QStyleOptionSlider
  • \l State_Enabled
  • Set if the dial is enabled. \row
  • \l State_HasFocus
  • Set if the dial has input focus.

\row

  • {1,6} \l {CC_ToolButton}
  • {1,6} \l QStyleOptionToolButton
  • \l State_Enabled
  • Set if the tool button is enabled. \row
  • \l State_HasFocus
  • Set if the tool button has input focus. \row
  • \l State_DownArrow
  • Set if the tool button is down (i.e., a mouse button or the space bar is pressed). \row
  • \l State_On
  • Set if the tool button is a toggle button and is toggled on. \row
  • \l State_AutoRaise
  • Set if the tool button has auto-raise enabled. \row
  • \l State_Raised
  • Set if the button is not down, not on, and doesn't contain the mouse when auto-raise is enabled.

\row

\endtable

See also
drawPrimitive(), drawControl()

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ drawControl()

virtual void QStyle::drawControl ( ControlElement element,
const QStyleOption * option,
QPainter * painter,
const QWidget * widget = nullptr ) const
pure virtual

Draws the given element with the provided painter with the style options specified by option.

The widget argument is optional and can be used as aid in drawing the control. The option parameter is a pointer to a QStyleOption object that can be cast to the correct subclass using the qstyleoption_cast() function.

The table below is listing the control elements and their associated style option subclass. The style options contain all the parameters required to draw the controls, including QStyleOption::state which holds the style flags that are used when drawing. The table also describes which flags that are set when casting the given option to the appropriate subclass.

Note that if a control element is not listed here, it is because it uses a plain QStyleOption object.

\table \header

  • Control Element
  • QStyleOption Subclass
  • Style Flag
  • Remark \row
  • {1,5} \l CE_MenuItem, \l CE_MenuBarItem
  • {1,5} \l QStyleOptionMenuItem
  • \l State_Selected
  • The menu item is currently selected item. \row
  • \l State_Enabled
  • The item is enabled. \row
  • \l State_DownArrow
  • Indicates that a scroll down arrow should be drawn. \row
  • \l State_UpArrow
  • Indicates that a scroll up arrow should be drawn \row
  • \l State_HasFocus
  • Set if the menu bar has input focus.

\row

  • {1,5} \l CE_PushButton, \l CE_PushButtonBevel, \l CE_PushButtonLabel
  • {1,5} \l QStyleOptionButton
  • \l State_Enabled
  • Set if the button is enabled. \row
  • \l State_HasFocus
  • Set if the button has input focus. \row
  • \l State_Raised
  • Set if the button is not down, not on and not flat. \row
  • \l State_On
  • Set if the button is a toggle button and is toggled on. \row
  • \l State_Sunken
  • Set if the button is down (i.e., the mouse button or the space bar is pressed on the button).

\row

  • {1,6} \l CE_RadioButton, \l CE_RadioButtonLabel, \l CE_CheckBox, \l CE_CheckBoxLabel
  • {1,6} \l QStyleOptionButton
  • \l State_Enabled
  • Set if the button is enabled. \row
  • \l State_HasFocus
  • Set if the button has input focus. \row
  • \l State_On
  • Set if the button is checked. \row
  • \l State_Off
  • Set if the button is not checked. \row
  • \l State_NoChange
  • Set if the button is in the NoChange state. \row
  • \l State_Sunken
  • Set if the button is down (i.e., the mouse button or the space bar is pressed on the button).

\row

  • {1,2} \l CE_ProgressBarContents, \l CE_ProgressBarLabel, \l CE_ProgressBarGroove
  • {1,2} \l QStyleOptionProgressBar
  • \l State_Enabled
  • Set if the progress bar is enabled. \row
  • \l State_HasFocus
  • Set if the progress bar has input focus.

\row

\row

  • {1,3} \l CE_TabBarTab, CE_TabBarTabShape, CE_TabBarTabLabel
  • {1,3} \l QStyleOptionTab
  • \l State_Enabled
  • Set if the tab bar is enabled. \row
  • \l State_Selected
  • The tab bar is the currently selected tab bar. \row
  • \l State_HasFocus
  • Set if the tab bar tab has input focus.

\row

  • {1,7} \l CE_ToolButtonLabel
  • {1,7} \l QStyleOptionToolButton
  • \l State_Enabled
  • Set if the tool button is enabled. \row
  • \l State_HasFocus
  • Set if the tool button has input focus. \row
  • \l State_Sunken
  • Set if the tool button is down (i.e., a mouse button or the space bar is pressed). \row
  • \l State_On
  • Set if the tool button is a toggle button and is toggled on. \row
  • \l State_AutoRaise
  • Set if the tool button has auto-raise enabled. \row
  • \l State_MouseOver
  • Set if the mouse pointer is over the tool button. \row
  • \l State_Raised
  • Set if the button is not down and is not on.

\row

  • \l CE_ToolBoxTab
  • \l QStyleOptionToolBox
  • \l State_Selected
  • The tab is the currently selected tab. \row
  • {1,3} \l CE_HeaderSection
  • {1,3} \l QStyleOptionHeader
  • \l State_Sunken
  • Indicates that the section is pressed. \row
  • \l State_UpArrow
  • Indicates that the sort indicator should be pointing up. \row
  • \l State_DownArrow
  • Indicates that the sort indicator should be pointing down. \endtable
See also
drawPrimitive(), drawComplexControl()

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ drawItemPixmap()

void QStyle::drawItemPixmap ( QPainter * painter,
const QRect & rectangle,
int alignment,
const QPixmap & pixmap ) const
virtual

Draws the given pixmap in the specified rectangle, according to the specified alignment, using the provided painter.

See also
drawItemText()

Reimplemented in QProxyStyle.

Definition at line 613 of file qstyle.cpp.

◆ drawItemText()

void QStyle::drawItemText ( QPainter * painter,
const QRect & rectangle,
int alignment,
const QPalette & palette,
bool enabled,
const QString & text,
QPalette::ColorRole textRole = QPalette::NoRole ) const
virtual

Draws the given text in the specified rectangle using the provided painter and palette.

The text is drawn using the painter's pen, and aligned and wrapped according to the specified alignment. If an explicit textRole is specified, the text is drawn using the palette's color for the given role. The enabled parameter indicates whether or not the item is enabled; when reimplementing this function, the enabled parameter should influence how the item is drawn.

See also
Qt::Alignment, drawItemPixmap()

Reimplemented in QMacStyle, QProxyStyle, and QQC2_NAMESPACE::QMacStyle.

Definition at line 575 of file qstyle.cpp.

◆ drawPrimitive()

virtual void QStyle::drawPrimitive ( PrimitiveElement element,
const QStyleOption * option,
QPainter * painter,
const QWidget * widget = nullptr ) const
pure virtual

Draws the given primitive element with the provided painter using the style options specified by option.

The widget argument is optional and may contain a widget that may aid in drawing the primitive element.

The table below is listing the primitive elements and their associated style option subclasses. The style options contain all the parameters required to draw the elements, including QStyleOption::state which holds the style flags that are used when drawing. The table also describes which flags that are set when casting the given option to the appropriate subclass.

Note that if a primitive element is not listed here, it is because it uses a plain QStyleOption object.

\table \header

  • Primitive Element
  • QStyleOption Subclass
  • Style Flag
  • Remark \row
  • \l PE_FrameFocusRect
  • \l QStyleOptionFocusRect
  • \l State_FocusAtBorder
  • Whether the focus is is at the border or inside the widget. \row
  • {1,2} \l PE_IndicatorCheckBox
  • {1,2} \l QStyleOptionButton
  • \l State_NoChange
  • Indicates a "tri-state" checkbox. \row
  • \l State_On
  • Indicates the indicator is checked. \row
  • \l PE_IndicatorRadioButton
  • \l QStyleOptionButton
  • \l State_On
  • Indicates that a radio button is selected. \row
  • \l State_NoChange
  • Indicates a "tri-state" controller. \row
  • \l State_Enabled
  • Indicates the controller is enabled. \row
  • {1,4} \l PE_IndicatorBranch
  • {1,4} \l QStyleOption
  • \l State_Children
  • Indicates that the control for expanding the tree to show child items, should be drawn. \row
  • \l State_Item
  • Indicates that a horizontal branch (to show a child item), should be drawn. \row
  • \l State_Open
  • Indicates that the tree branch is expanded. \row
  • \l State_Sibling
  • Indicates that a vertical line (to show a sibling item), should be drawn. \row
  • \l PE_IndicatorHeaderArrow
  • \l QStyleOptionHeader
  • \l State_UpArrow
  • Indicates that the arrow should be drawn up; otherwise it should be down. \row
  • \l PE_FrameGroupBox, \l PE_Frame, \l PE_FrameLineEdit, \l PE_FrameMenu, \l PE_FrameDockWidget, \l PE_FrameWindow
  • \l QStyleOptionFrame
  • \l State_Sunken
  • Indicates that the Frame should be sunken. \row
  • \l PE_IndicatorToolBarHandle
  • \l QStyleOption
  • \l State_Horizontal
  • Indicates that the window handle is horizontal instead of vertical. \row
  • \l PE_IndicatorSpinPlus, \l PE_IndicatorSpinMinus, \l PE_IndicatorSpinUp, \l PE_IndicatorSpinDown,
  • \l QStyleOptionSpinBox
  • \l State_Sunken
  • Indicates that the button is pressed. \row
  • {1,5} \l PE_PanelButtonCommand
  • {1,5} \l QStyleOptionButton
  • \l State_Enabled
  • Set if the button is enabled. \row
  • \l State_HasFocus
  • Set if the button has input focus. \row
  • \l State_Raised
  • Set if the button is not down, not on and not flat. \row
  • \l State_On
  • Set if the button is a toggle button and is toggled on. \row
  • \l State_Sunken
  • Set if the button is down (i.e., the mouse button or the space bar is pressed on the button). \endtable
See also
drawComplexControl(), drawControl()

Implemented in CustomStyle, QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ generatedIconPixmap()

virtual QPixmap QStyle::generatedIconPixmap ( QIcon::Mode iconMode,
const QPixmap & pixmap,
const QStyleOption * option ) const
pure virtual

Returns a copy of the given pixmap, styled to conform to the specified iconMode and taking into account the palette specified by option.

The option parameter can pass extra information, but it must contain a palette.

Note that not all pixmaps will conform, in which case the returned pixmap is a plain copy.

See also
QIcon

Implemented in QCommonStyle, QMacStyle, QProxyStyle, and QQC2_NAMESPACE::QMacStyle.

◆ hitTestComplexControl()

virtual SubControl QStyle::hitTestComplexControl ( ComplexControl control,
const QStyleOptionComplex * option,
const QPoint & position,
const QWidget * widget = nullptr ) const
pure virtual

Returns the sub control at the given position in the given complex control (with the style options specified by option).

Note that the position is expressed in screen coordinates.

The option argument is a pointer to a QStyleOptionComplex object (or one of its subclasses). The object can be cast to the appropriate type using the qstyleoption_cast() function. See drawComplexControl() for details. The widget argument is optional and can contain additional information for the function.

See also
drawComplexControl(), subControlRect()

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ itemPixmapRect()

QRect QStyle::itemPixmapRect ( const QRect & r,
int flags,
const QPixmap & pixmap ) const
virtual

Returns the area within the given rectangle in which to draw the specified pixmap according to the defined alignment.

Reimplemented in QProxyStyle.

Definition at line 535 of file qstyle.cpp.

◆ itemTextRect()

QRect QStyle::itemTextRect ( const QFontMetrics & metrics,
const QRect & rectangle,
int alignment,
bool enabled,
const QString & text ) const
virtual

Returns the area within the given rectangle in which to draw the provided text according to the specified font metrics and alignment.

The enabled parameter indicates whether or not the associated item is enabled.

If the given rectangle is larger than the area needed to render the text, the rectangle that is returned will be offset within rectangle according to the specified alignment. For example, if alignment is Qt::AlignCenter, the returned rectangle will be centered within rectangle. If the given rectangle is smaller than the area needed, the returned rectangle will be the smallest rectangle large enough to render the text.

See also
Qt::Alignment

Reimplemented in QProxyStyle.

Definition at line 511 of file qstyle.cpp.

◆ layoutSpacing()

virtual int QStyle::layoutSpacing ( QSizePolicy::ControlType control1,
QSizePolicy::ControlType control2,
Qt::Orientation orientation,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
pure virtual
Since
4.3

Returns the spacing that should be used between control1 and control2 in a layout. orientation specifies whether the controls are laid out side by side or stacked vertically. The option parameter can be used to pass extra information about the parent widget. The widget parameter is optional and can also be used if option is \nullptr.

This function is called by the layout system. It is used only if PM_LayoutHorizontalSpacing or PM_LayoutVerticalSpacing returns a negative value.

See also
combinedLayoutSpacing()

Implemented in QCommonStyle, QMacStyle, and QProxyStyle.

◆ name()

QString QStyle::name ( ) const

Returns the name of the style.

This value can be used to create a style with QStyleFactory::create().

See also
QStyleFactory::create()
Since
6.1

Definition at line 397 of file qstyle.cpp.

Referenced by testing.tools.encode_pdf_filter._PdfStream::RegisterByName().

+ Here is the caller graph for this function:

◆ pixelMetric()

virtual int QStyle::pixelMetric ( PixelMetric metric,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
pure virtual

Returns the value of the given pixel metric.

The specified option and widget can be used for calculating the metric. The option can be cast to the appropriate type using the qstyleoption_cast() function. Note that the option may be zero even for PixelMetrics that can make use of it. See the table below for the appropriate option casts:

\table \header

  • Pixel Metric
  • QStyleOption Subclass \row
  • \l PM_SliderControlThickness
  • \l QStyleOptionSlider \row
  • \l PM_SliderLength
  • \l QStyleOptionSlider \row
  • \l PM_SliderTickmarkOffset
  • \l QStyleOptionSlider \row
  • \l PM_SliderSpaceAvailable
  • \l QStyleOptionSlider \row
  • \l PM_ScrollBarExtent
  • \l QStyleOptionSlider \row
  • \l PM_TabBarTabOverlap
  • \l QStyleOptionTab \row
  • \l PM_TabBarTabHSpace
  • \l QStyleOptionTab \row
  • \l PM_TabBarTabVSpace
  • \l QStyleOptionTab \row
  • \l PM_TabBarBaseHeight
  • \l QStyleOptionTab \row
  • \l PM_TabBarBaseOverlap
  • \l QStyleOptionTab \endtable

Some pixel metrics are called from widgets and some are only called internally by the style. If the metric is not called by a widget, it is the discretion of the style author to make use of it. For some styles, this may not be appropriate.

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ polish() [1/3]

void QStyle::polish ( QApplication * application)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Late initialization of the given application object.

Reimplemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

Definition at line 466 of file qstyle.cpp.

◆ polish() [2/3]

void QStyle::polish ( QPalette & palette)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Changes the palette according to style specific requirements for color palettes (if any).

See also
QPalette, QApplication::setPalette()

Reimplemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

Definition at line 489 of file qstyle.cpp.

◆ polish() [3/3]

void QStyle::polish ( QWidget * widget)
virtual

Initializes the appearance of the given widget.

This function is called for every widget at some point after it has been fully created but just before it is shown for the very first time.

Note that the default implementation does nothing. Reasonable actions in this function might be to call the QWidget::setBackgroundMode() function for the widget. Do not use the function to set, for example, the geometry. Reimplementing this function provides a back-door through which the appearance of a widget can be changed, but with Qt's style engine it is rarely necessary to implement this function; reimplement drawItemPixmap(), drawItemText(), drawPrimitive(), etc. instead.

The QWidget::inherits() function may provide enough information to allow class-specific customizations. But because new QStyle subclasses are expected to work reasonably with all current and future widgets, limited use of hard-coded customization is recommended.

See also
unpolish()

Reimplemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

Definition at line 437 of file qstyle.cpp.

◆ proxy()

const QStyle * QStyle::proxy ( ) const
Since
4.6

This function returns the current proxy for this style. By default most styles will return themselves. However when a proxy style is in use, it will allow the style to call back into its proxy.

Definition at line 2401 of file qstyle.cpp.

◆ sizeFromContents()

virtual QSize QStyle::sizeFromContents ( ContentsType type,
const QStyleOption * option,
const QSize & contentsSize,
const QWidget * widget = nullptr ) const
pure virtual

Returns the size of the element described by the specified option and type, based on the provided contentsSize.

The option argument is a pointer to a QStyleOption or one of its subclasses. The option can be cast to the appropriate type using the qstyleoption_cast() function. The widget is an optional argument and can contain extra information used for calculating the size.

See the table below for the appropriate option casts:

\table \header

See also
ContentsType, QStyleOption

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ sliderPositionFromValue()

int QStyle::sliderPositionFromValue ( int min,
int max,
int logicalValue,
int span,
bool upsideDown = false )
static

Converts the given logicalValue to a pixel position.

The min parameter maps to 0, max maps to span and other values are distributed evenly in-between.

This function can handle the entire integer range without overflow, providing that span is less than 4096.

By default, this function assumes that the maximum value is on the right for horizontal items and on the bottom for vertical items. Set the upsideDown parameter to true to reverse this behavior.

See also
sliderValueFromPosition()

Definition at line 2223 of file qstyle.cpp.

◆ sliderValueFromPosition()

int QStyle::sliderValueFromPosition ( int min,
int max,
int position,
int span,
bool upsideDown = false )
static

Converts the given pixel position to a logical value.

0 maps to the min parameter, span maps to max and other values are distributed evenly in-between.

This function can handle the entire integer range without overflow.

By default, this function assumes that the maximum value is on the right for horizontal items and on the bottom for vertical items. Set the upsideDown parameter to true to reverse this behavior.

See also
sliderPositionFromValue()

Definition at line 2268 of file qstyle.cpp.

◆ standardIcon()

virtual QIcon QStyle::standardIcon ( StandardPixmap standardIcon,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
pure virtual
Since
4.1

Returns an icon for the given standardIcon.

The standardIcon is a standard pixmap which can follow some existing GUI style or guideline. The option argument can be used to pass extra information required when defining the appropriate icon. The widget argument is optional and can also be used to aid the determination of the icon.

Implemented in QCommonStyle, QMacStyle, and QProxyStyle.

◆ standardPalette()

QPalette QStyle::standardPalette ( ) const
virtual

Returns the style's standard palette.

Note that on systems that support system colors, the style's standard palette is not used. In particular, the Windows Vista and Mac styles do not use the standard palette, but make use of native theme engines. With these styles, you should not set the palette with QApplication::setPalette().

See also
QApplication::setPalette()

Reimplemented in QMacStyle, and QProxyStyle.

Definition at line 2302 of file qstyle.cpp.

◆ standardPixmap()

virtual QPixmap QStyle::standardPixmap ( StandardPixmap standardPixmap,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr ) const
pure virtual
Deprecated
Returns a pixmap for the given standardPixmap.

A standard pixmap is a pixmap that can follow some existing GUI style or guideline. The option argument can be used to pass extra information required when defining the appropriate pixmap. The widget argument is optional and can also be used to aid the determination of the pixmap.

Developers calling standardPixmap() should instead call standardIcon() Developers who re-implemented standardPixmap() should instead re-implement standardIcon().

See also
standardIcon()
Deprecated
Returns a pixmap for the given standardPixmap.

A standard pixmap is a pixmap that can follow some existing GUI style or guideline. The option argument can be used to pass extra information required when defining the appropriate pixmap. The widget argument is optional and can also be used to aid the determination of the pixmap.

Developers calling standardPixmap() should instead call standardIcon() Developers who re-implemented standardPixmap() should instead re-implement standardIcon().

See also
standardIcon()

Implemented in QCommonStyle, QMacStyle, and QProxyStyle.

◆ styleHint()

virtual int QStyle::styleHint ( StyleHint hint,
const QStyleOption * option = nullptr,
const QWidget * widget = nullptr,
QStyleHintReturn * returnData = nullptr ) const
pure virtual

Returns an integer representing the specified style hint for the given widget described by the provided style option.

returnData is used when the querying widget needs more detailed data than the integer that styleHint() returns. See the QStyleHintReturn class description for details.

Implemented in MyProxyStyle, MyProxyStyle, QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ subControlRect()

virtual QRect QStyle::subControlRect ( ComplexControl control,
const QStyleOptionComplex * option,
SubControl subControl,
const QWidget * widget = nullptr ) const
pure virtual

Returns the rectangle containing the specified subControl of the given complex control (with the style specified by option).

The rectangle is defined in screen coordinates.

The option argument is a pointer to QStyleOptionComplex or one of its subclasses, and can be cast to the appropriate type using the qstyleoption_cast() function. See drawComplexControl() for details. The widget is optional and can contain additional information for the function.

See also
drawComplexControl()

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ subElementRect()

virtual QRect QStyle::subElementRect ( SubElement element,
const QStyleOption * option,
const QWidget * widget = nullptr ) const
pure virtual

Returns the sub-area for the given element as described in the provided style option.

The returned rectangle is defined in screen coordinates.

The widget argument is optional and can be used to aid determining the area. The QStyleOption object can be cast to the appropriate type using the qstyleoption_cast() function. See the table below for the appropriate option casts:

\table \header

Implemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

◆ unpolish() [1/2]

void QStyle::unpolish ( QApplication * application)
virtual

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.Uninitialize the given application.

Reimplemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

Definition at line 476 of file qstyle.cpp.

◆ unpolish() [2/2]

void QStyle::unpolish ( QWidget * widget)
virtual

Uninitialize the given {widget}'s appearance.

This function is the counterpart to polish(). It is called for every polished widget whenever the style is dynamically changed; the former style has to unpolish its settings before the new style can polish them again.

Note that unpolish() will only be called if the widget is destroyed. This can cause problems in some cases, e.g, if you remove a widget from the UI, cache it, and then reinsert it after the style has changed; some of Qt's classes cache their widgets.

See also
polish()

Reimplemented in QCommonStyle, QMacStyle, QPixmapStyle, and QProxyStyle.

Definition at line 456 of file qstyle.cpp.

◆ visualAlignment()

Qt::Alignment QStyle::visualAlignment ( Qt::LayoutDirection direction,
Qt::Alignment alignment )
static

Transforms an alignment of Qt::AlignLeft or Qt::AlignRight without Qt::AlignAbsolute into Qt::AlignLeft or Qt::AlignRight with Qt::AlignAbsolute according to the layout direction.

The other alignment flags are left untouched.

If no horizontal alignment was specified, the function returns the default alignment for the given layout direction.

QWidget::layoutDirection

Definition at line 2203 of file qstyle.cpp.

◆ visualPos()

QPoint QStyle::visualPos ( Qt::LayoutDirection direction,
const QRect & boundingRectangle,
const QPoint & logicalPosition )
static

Returns the given logicalPosition converted to screen coordinates based on the specified direction.

The boundingRectangle is used when performing the translation.

See also
QWidget::layoutDirection

Definition at line 2163 of file qstyle.cpp.

◆ visualRect()

QRect QStyle::visualRect ( Qt::LayoutDirection direction,
const QRect & boundingRectangle,
const QRect & logicalRectangle )
static

Returns the given logicalRectangle converted to screen coordinates based on the specified direction.

The boundingRectangle is used when performing the translation.

This function is provided to support right-to-left desktops, and is typically used in implementations of the subControlRect() function.

See also
QWidget::layoutDirection

Definition at line 2144 of file qstyle.cpp.

Friends And Related Symbol Documentation

◆ QApplication

friend class QApplication
friend

Definition at line 839 of file qstyle.h.

◆ QProxyStyle

friend class QProxyStyle
friend

Definition at line 840 of file qstyle.h.

◆ QProxyStylePrivate

friend class QProxyStylePrivate
friend

Definition at line 841 of file qstyle.h.

◆ QStyleFactory

friend class QStyleFactory
friend

Definition at line 842 of file qstyle.h.

◆ QStyleSheetProxySaver

friend class QStyleSheetProxySaver
friend

Definition at line 843 of file qstyle.h.

◆ QWidget

friend class QWidget
friend

Definition at line 837 of file qstyle.h.

◆ QWidgetPrivate

friend class QWidgetPrivate
friend

Definition at line 838 of file qstyle.h.


The documentation for this class was generated from the following files: