The QStyle class specifies the look and feel of a GUI.
.PP
A large number of GUI elements are common to many widgets. The QStyle class allows the look of these elements to be modified across all widgets that use the QStyle functions. It also provides two feel options: Motif and Windows.
.PP
Although it is not possible to fully enumerate the look of graphical elements and the feel of widgets in a GUI, QStyle provides a considerable amount of control and customisability.
.PP
In Qt 1.x the look and feel option for widgets was specified by a single value: the GUIStyle. Starting with Qt 2.0, this notion was expanded to allow the look to be specified by virtual drawing functions.
.PP
Derived classes may reimplement some or all of the drawing functions to modify the look of all widgets that use those functions.
.PP
Languages written from right to left (such as Arabic and Hebrew) usually also mirror the whole layout of widgets. If you design a style, you should take special care when drawing asymmetric elements to make sure that they also look correct in a mirrored layout. You can start your application with \fC-reverse\fR to check the mirrored layout. Also notice, that for a reversed layout, the light usually comes from top right instead of top left.
.PP
The actual reverse layout is performed automatically when possible. However, for the sake of flexibility, the translation cannot be performed everywhere. The documentation for each function in the QStyle API states whether the function expects/returns logical or screen coordinates. Using logical coordinates (in ComplexControls, for example) provides great flexibility in controlling the look of a widget. Use visualRect() when necessary to translate logical coordinates into screen coordinates for drawing.
.PP
In Qt versions prior to 3.0, if you wanted a low level route into changing the appearance of a widget, you would reimplement polish(). With the new 3.0 style engine the recommended approach is to reimplement the draw functions, for example drawItem(), drawPrimitive(), drawControl(), drawControlMask(), drawComplexControl() and drawComplexControlMask(). Each of these functions is called with a range of parameters that provide information that you can use to determine how to draw them, e.g. style flags, rectangle, color group, etc.
.PP
For information on changing elements of an existing style or creating your own style see the Style overview.
.PP
Styles can also be created as plugins.
.PP
See also Widget Appearance and Style.
.SS "Member Type Documentation"
.SH "QStyle::ComplexControl"
This enum represents a ComplexControl. ComplexControls have different behaviour depending upon where the user clicks on them or which keys are pressed.
.TP
\fCQStyle::CC_SpinWidget\fR
.TP
\fCQStyle::CC_ComboBox\fR
.TP
\fCQStyle::CC_ScrollBar\fR
.TP
\fCQStyle::CC_Slider\fR
.TP
\fCQStyle::CC_ToolButton\fR
.TP
\fCQStyle::CC_TitleBar\fR
.TP
\fCQStyle::CC_ListView\fR
.TP
\fCQStyle::CC_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.PP
See also SubControl and drawComplexControl().
.SH "QStyle::ContentsType"
This enum represents a ContentsType. It is used to calculate sizes for the contents of various widgets.
.TP
\fCQStyle::CT_PushButton\fR
.TP
\fCQStyle::CT_CheckBox\fR
.TP
\fCQStyle::CT_RadioButton\fR
.TP
\fCQStyle::CT_ToolButton\fR
.TP
\fCQStyle::CT_ComboBox\fR
.TP
\fCQStyle::CT_Splitter\fR
.TP
\fCQStyle::CT_DockWindow\fR
.TP
\fCQStyle::CT_ProgressBar\fR
.TP
\fCQStyle::CT_PopupMenuItem\fR
.TP
\fCQStyle::CT_TabBarTab\fR
.TP
\fCQStyle::CT_Slider\fR
.TP
\fCQStyle::CT_Header\fR
.TP
\fCQStyle::CT_LineEdit\fR
.TP
\fCQStyle::CT_MenuBar\fR
.TP
\fCQStyle::CT_SpinBox\fR
.TP
\fCQStyle::CT_SizeGrip\fR
.TP
\fCQStyle::CT_TabWidget\fR
.TP
\fCQStyle::CT_DialogButtons\fR
.TP
\fCQStyle::CT_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Custom values must be greater than this value.
.PP
See also sizeFromContents().
.SH "QStyle::ControlElement"
This enum represents a ControlElement. A ControlElement is part of a widget that performs some action or displays information to the user.
.TP
\fCQStyle::CE_PushButton\fR - the bevel and default indicator of a QPushButton.
.TP
\fCQStyle::CE_PushButtonLabel\fR - the label (iconset with text or pixmap) of a QPushButton.
.TP
\fCQStyle::CE_CheckBox\fR - the indicator of a QCheckBox.
.TP
\fCQStyle::CE_CheckBoxLabel\fR - the label (text or pixmap) of a QCheckBox.
.TP
\fCQStyle::CE_RadioButton\fR - the indicator of a QRadioButton.
.TP
\fCQStyle::CE_RadioButtonLabel\fR - the label (text or pixmap) of a QRadioButton.
.TP
\fCQStyle::CE_TabBarTab\fR - the tab within a QTabBar (a QTab).
.TP
\fCQStyle::CE_TabBarLabel\fR - the label within a QTab.
.TP
\fCQStyle::CE_ProgressBarGroove\fR - the groove where the progress indicator is drawn in a QProgressBar.
.TP
\fCQStyle::CE_ProgressBarContents\fR - the progress indicator of a QProgressBar.
.TP
\fCQStyle::CE_ProgressBarLabel\fR - the text label of a QProgressBar.
.TP
\fCQStyle::CE_PopupMenuItem\fR - a menu item in a QPopupMenu.
.TP
\fCQStyle::CE_PopupMenuScroller\fR - scrolling areas in a popumenu when the style supports scrolling.
.TP
\fCQStyle::CE_PopupMenuHorizontalExtra\fR - extra frame area set aside with PM_PopupMenuFrameHorizontalExtra
.TP
\fCQStyle::CE_PopupMenuVerticalExtra\fR - extra frame area set aside with PM_PopupMenuFrameVerticalExtra
.TP
\fCQStyle::CE_MenuBarItem\fR - a menu item in a QMenuBar.
.TP
\fCQStyle::CE_ToolButtonLabel\fR - a tool button's label.
.TP
\fCQStyle::CE_MenuBarEmptyArea\fR - the empty area of a QMenuBar.
.TP
\fCQStyle::CE_DockWindowEmptyArea\fR - the empty area of a QDockWindow.
.TP
\fCQStyle::CE_ToolBoxTab\fR - the toolbox's tab area
.TP
\fCQStyle::CE_HeaderLabel\fR - the header's label
.TP
\fCQStyle::CE_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.PP
See also drawControl().
.SH "QStyle::PixelMetric"
This enum represents a PixelMetric. A PixelMetric is a style dependent size represented as a single pixel value.
.TP
\fCQStyle::PM_ButtonMargin\fR - amount of whitespace between pushbutton labels and the frame.
.TP
\fCQStyle::PM_ButtonDefaultIndicator\fR - width of the default-button indicator frame.
.TP
\fCQStyle::PM_MenuButtonIndicator\fR - width of the menu button indicator proportional to the widget height.
.TP
\fCQStyle::PM_ButtonShiftHorizontal\fR - horizontal contents shift of a button when the button is down.
.TP
\fCQStyle::PM_ButtonShiftVertical\fR - vertical contents shift of a button when the button is down.
.TP
\fCQStyle::PM_DefaultFrameWidth\fR - default frame width, usually 2.
.TP
\fCQStyle::PM_SpinBoxFrameWidth\fR - frame width of a spin box.
.TP
\fCQStyle::PM_MDIFrameWidth\fR - frame width of an MDI window.
.TP
\fCQStyle::PM_MDIMinimizedWidth\fR - width of a minimized MSI window.
\fCQStyle::PM_MaximumDragDistance\fR - Some feels require the scrollbar or other sliders to jump back to the original position when the mouse pointer is too far away while dragging. A value of -1 disables this behavior.
\fCQStyle::PM_ScrollBarExtent\fR - width of a vertical scrollbar and the height of a horizontal scrollbar.
.TP
\fCQStyle::PM_ScrollBarSliderMin\fR - the minimum height of a vertical scrollbar's slider and the minimum width of a horiztonal scrollbar slider.
.TP
\fCQStyle::PM_SliderThickness\fR - total slider thickness.
.TP
\fCQStyle::PM_SliderControlThickness\fR - thickness of the slider handle.
.TP
\fCQStyle::PM_SliderLength\fR - length of the slider.
.TP
\fCQStyle::PM_SliderTickmarkOffset\fR - the offset between the tickmarks and the slider.
.TP
\fCQStyle::PM_SliderSpaceAvailable\fR - the available space for the slider to move.
.TP
\fCQStyle::PM_DockWindowSeparatorExtent\fR - width of a separator in a horiztonal dock window and the height of a separator in a vertical dock window.
.TP
\fCQStyle::PM_DockWindowHandleExtent\fR - width of the handle in a horizontal dock window and the height of the handle in a vertical dock window.
.TP
\fCQStyle::PM_DockWindowFrameWidth\fR - frame width of a dock window.
.TP
\fCQStyle::PM_MenuBarFrameWidth\fR - frame width of a menubar.
.TP
\fCQStyle::PM_MenuBarItemSpacing\fR - spacing between menubar items.
.TP
\fCQStyle::PM_ToolBarItemSpacing\fR - spacing between toolbar items.
.TP
\fCQStyle::PM_TabBarTabOverlap\fR - number of pixels the tabs should overlap.
.TP
\fCQStyle::PM_TabBarTabHSpace\fR - extra space added to the tab width.
.TP
\fCQStyle::PM_TabBarTabVSpace\fR - extra space added to the tab height.
.TP
\fCQStyle::PM_TabBarBaseHeight\fR - height of the area between the tab bar and the tab pages.
.TP
\fCQStyle::PM_TabBarBaseOverlap\fR - number of pixels the tab bar overlaps the tab bar base.
.TP
\fCQStyle::PM_TabBarScrollButtonWidth\fR
.TP
\fCQStyle::PM_TabBarTabShiftHorizontal\fR - horizontal pixel shift when a tab is selected.
.TP
\fCQStyle::PM_TabBarTabShiftVertical\fR - vertical pixel shift when a tab is selected.
.TP
\fCQStyle::PM_ProgressBarChunkWidth\fR - width of a chunk in a progress bar indicator.
.TP
\fCQStyle::PM_SplitterWidth\fR - width of a splitter.
.TP
\fCQStyle::PM_TitleBarHeight\fR - height of the title bar.
.TP
\fCQStyle::PM_PopupMenuFrameHorizontalExtra\fR - additional border, e.g. for panels
.TP
\fCQStyle::PM_PopupMenuFrameVerticalExtra\fR - additional border, e.g. for panels
.TP
\fCQStyle::PM_IndicatorWidth\fR - width of a check box indicator.
.TP
\fCQStyle::PM_IndicatorHeight\fR - height of a checkbox indicator.
.TP
\fCQStyle::PM_ExclusiveIndicatorWidth\fR - width of a radio button indicator.
.TP
\fCQStyle::PM_ExclusiveIndicatorHeight\fR - height of a radio button indicator.
.TP
\fCQStyle::PM_PopupMenuScrollerHeight\fR - height of the scroller area in a popupmenu.
.TP
\fCQStyle::PM_PopupMenuScrollerHeight\fR - height of the scroller area in a popupmenu.
.TP
\fCQStyle::PM_CheckListButtonSize\fR - area (width/height) of the checkbox/radiobutton in a QCheckListItem
.TP
\fCQStyle::PM_CheckListControllerSize\fR - area (width/height) of the controller in a QCheckListItem
.TP
\fCQStyle::PM_DialogButtonsSeparator\fR - distance between buttons in a dialog buttons widget.
.TP
\fCQStyle::PM_DialogButtonsButtonWidth\fR - minimum width of a button in a dialog buttons widget.
.TP
\fCQStyle::PM_DialogButtonsButtonHeight\fR - minimum height of a button in a dialog buttons widget.
.TP
\fCQStyle::PM_HeaderMarkSize\fR
.TP
\fCQStyle::PM_HeaderGripMargin\fR
.TP
\fCQStyle::PM_HeaderMargin\fR
.TP
\fCQStyle::PM_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.PP
See also pixelMetric().
.SH "QStyle::PrimitiveElement"
This enum represents the PrimitiveElements of a style. A PrimitiveElement is a common GUI element, such as a checkbox indicator or pushbutton bevel.
.TP
\fCQStyle::PE_ButtonCommand\fR - button used to initiate an action, for example, a QPushButton.
.TP
\fCQStyle::PE_ButtonDefault\fR - this button is the default button, e.g. in a dialog.
\fCQStyle::PE_ScrollBarFirst\fR - scrollbar first line indicator (i.e. home).
.TP
\fCQStyle::PE_ScrollBarLast\fR - scrollbar last line indicator (i.e. end).
.TP
\fCQStyle::PE_ProgressBarChunk\fR - section of a progress bar indicator; see also QProgressBar.
.TP
\fCQStyle::PE_CheckListController\fR - controller part of a listview item
.TP
\fCQStyle::PE_CheckListIndicator\fR - checkbox part of a listview item
.TP
\fCQStyle::PE_CheckListExclusiveIndicator\fR - radiobutton part of a listview item
.TP
\fCQStyle::PE_RubberBand\fR - rubber band used in such things as iconview
.TP
\fCQStyle::PE_CustomBase\fR - base value for custom PrimitiveElements. All values above this are reserved for custom use. Custom values must be greater than this value.
.PP
See also drawPrimitive().
.SH "QStyle::StyleFlags"
This enum represents flags for drawing PrimitiveElements. Not all primitives use all of these flags. Note that these flags may mean different things to different primitives. For an explanation of the relationship between primitives and their flags, as well as the different meanings of the flags, see the Style overview.
.TP
\fCQStyle::Style_Default\fR
.TP
\fCQStyle::Style_Enabled\fR
.TP
\fCQStyle::Style_Raised\fR
.TP
\fCQStyle::Style_Sunken\fR
.TP
\fCQStyle::Style_Off\fR
.TP
\fCQStyle::Style_NoChange\fR
.TP
\fCQStyle::Style_On\fR
.TP
\fCQStyle::Style_Down\fR
.TP
\fCQStyle::Style_Horizontal\fR
.TP
\fCQStyle::Style_HasFocus\fR
.TP
\fCQStyle::Style_Top\fR
.TP
\fCQStyle::Style_Bottom\fR
.TP
\fCQStyle::Style_FocusAtBorder\fR
.TP
\fCQStyle::Style_AutoRaise\fR
.TP
\fCQStyle::Style_MouseOver\fR
.TP
\fCQStyle::Style_Up\fR
.TP
\fCQStyle::Style_Selected\fR
.TP
\fCQStyle::Style_HasFocus\fR
.TP
\fCQStyle::Style_Active\fR
.TP
\fCQStyle::Style_ButtonDefault\fR
.PP
See also drawPrimitive().
.SH "QStyle::StyleHint"
This enum represents a StyleHint. A StyleHint is a general look and/or feel hint.
.TP
\fCQStyle::SH_EtchDisabledText\fR - disabled text is "etched" like Windows.
.TP
\fCQStyle::SH_GUIStyle\fR - the GUI style to use.
.TP
\fCQStyle::SH_ScrollBar_BackgroundMode\fR - the background mode for a QScrollBar. Possible values are any of those in the BackgroundMode enum.
.TP
\fCQStyle::SH_ScrollBar_MiddleClickAbsolutePosition\fR - a boolean value. If TRUE, middle clicking on a scrollbar causes the slider to jump to that position. If FALSE, the middle clicking is ignored.
.TP
\fCQStyle::SH_ScrollBar_LeftClickAbsolutePosition\fR - a boolean value. If TRUE, left clicking on a scrollbar causes the slider to jump to that position. If FALSE, the left clicking will behave as appropriate for each control.
.TP
\fCQStyle::SH_ScrollBar_ScrollWhenPointerLeavesControl\fR - a boolean value. If TRUE, when clicking a scrollbar SubControl, holding the mouse button down and moving the pointer outside the SubControl, the scrollbar continues to scroll. If FALSE, the scollbar stops scrolling when the pointer leaves the SubControl.
.TP
\fCQStyle::SH_TabBar_Alignment\fR - the alignment for tabs in a QTabWidget. Possible values are Qt::AlignLeft, Qt::AlignCenter and Qt::AlignRight.
.TP
\fCQStyle::SH_Header_ArrowAlignment\fR - the placement of the sorting indicator may appear in list or table headers. Possible values are Qt::Left or Qt::Right.
.TP
\fCQStyle::SH_Slider_SnapToValue\fR - sliders snap to values while moving, like Windows
.TP
\fCQStyle::SH_Slider_SloppyKeyEvents\fR - key presses handled in a sloppy manner, i.e. left on a vertical slider subtracts a line.
.TP
\fCQStyle::SH_ProgressDialog_CenterCancelButton\fR - center button on progress dialogs, like Motif, otherwise right aligned.
.TP
\fCQStyle::SH_ProgressDialog_TextLabelAlignment\fR - Qt::AlignmentFlags -- text label alignment in progress dialogs; Center on windows, Auto|VCenter otherwise.
.TP
\fCQStyle::SH_PrintDialog_RightAlignButtons\fR - right align buttons in the print dialog, like Windows.
.TP
\fCQStyle::SH_MainWindow_SpaceBelowMenuBar\fR - 1 or 2 pixel space between the menubar and the dockarea, like Windows.
.TP
\fCQStyle::SH_FontDialog_SelectAssociatedText\fR - select the text in the line edit, or when selecting an item from the listbox, or when the line edit receives focus, like Windows.
.TP
\fCQStyle::SH_PopupMenu_AllowActiveAndDisabled\fR - allows disabled menu items to be active.
.TP
\fCQStyle::SH_PopupMenu_SpaceActivatesItem\fR - pressing Space activates the item, like Motif.
.TP
\fCQStyle::SH_PopupMenu_SubMenuPopupDelay\fR - the number of milliseconds to wait before opening a submenu; 256 on windows, 96 on Motif.
.TP
\fCQStyle::SH_PopupMenu_Scrollable\fR - whether popupmenu's must support scrolling.
.TP
\fCQStyle::SH_PopupMenu_SloppySubMenus\fR - whether popupmenu's must support sloppy submenu; as implemented on Mac OS.
.TP
\fCQStyle::SH_ScrollView_FrameOnlyAroundContents\fR - whether scrollviews draw their frame only around contents (like Motif), or around contents, scrollbars and corner widgets (like Windows).
.TP
\fCQStyle::SH_MenuBar_AltKeyNavigation\fR - menubars items are navigable by pressing Alt, followed by using the arrow keys to select the desired item.
.TP
\fCQStyle::SH_ComboBox_ListMouseTracking\fR - mouse tracking in combobox dropdown lists.
.TP
\fCQStyle::SH_PopupMenu_MouseTracking\fR - mouse tracking in popup menus.
.TP
\fCQStyle::SH_MenuBar_MouseTracking\fR - mouse tracking in menubars.
.TP
\fCQStyle::SH_ItemView_ChangeHighlightOnFocus\fR - gray out selected items when losing focus.
.TP
\fCQStyle::SH_Widget_ShareActivation\fR - turn on sharing activation with floating modeless dialogs.
.TP
\fCQStyle::SH_TabBar_SelectMouseType\fR - which type of mouse event should cause a tab to be selected.
.TP
\fCQStyle::SH_ListViewExpand_SelectMouseType\fR - which type of mouse event should cause a listview expansion to be selected.
.TP
\fCQStyle::SH_TabBar_PreferNoArrows\fR - whether a tabbar should suggest a size to prevent scoll arrows.
.TP
\fCQStyle::SH_ComboBox_Popup\fR - allows popups as a combobox dropdown menu.
.TP
\fCQStyle::SH_Workspace_FillSpaceOnMaximize\fR - the workspace should maximize the client area.
.TP
\fCQStyle::SH_TitleBar_NoBorder\fR - the titlebar has no border
.TP
\fCQStyle::SH_ScrollBar_StopMouseOverSlider\fR - stops autorepeat when slider reaches mouse
.TP
\fCQStyle::SH_BlinkCursorWhenTextSelected\fR - whether cursor should blink when text is selected
.TP
\fCQStyle::SH_RichText_FullWidthSelection\fR - whether richtext selections should extend the full width of the document.
.TP
\fCQStyle::SH_GroupBox_TextLabelVerticalAlignment\fR - how to vertically align a groupbox's text label.
.TP
\fCQStyle::SH_GroupBox_TextLabelColor\fR - how to paint a groupbox's text label.
.TP
\fCQStyle::SH_DialogButtons_DefaultButton\fR - which buttons gets the default status in a dialog's button widget.
.TP
\fCQStyle::SH_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.TP
\fCQStyle::SH_ToolButton_Uses3D\fR - indicates whether QToolButtons should use a 3D frame when the mouse is over them
.TP
\fCQStyle::SH_ToolBox_SelectedPageTitleBold\fR - Boldness of the selected page title in a QToolBox.
.TP
\fCQStyle::SH_LineEdit_PasswordCharacter\fR - The QChar Unicode character to be used for passwords.
.TP
\fCQStyle::SH_Table_GridLineColor\fR
.TP
\fCQStyle::SH_UnderlineAccelerator\fR - whether accelerators are underlined
.PP
See also styleHint().
.SH "QStyle::StylePixmap"
This enum represents a StylePixmap. A StylePixmap is a pixmap that can follow some existing GUI style or guideline.
.TP
\fCQStyle::SP_TitleBarMinButton\fR - minimize button on titlebars. For example, in a QWorkspace.
.TP
\fCQStyle::SP_TitleBarMaxButton\fR - maximize button on titlebars.
.TP
\fCQStyle::SP_TitleBarCloseButton\fR - close button on titlebars.
.TP
\fCQStyle::SP_TitleBarNormalButton\fR - normal (restore) button on titlebars.
.TP
\fCQStyle::SP_TitleBarShadeButton\fR - shade button on titlebars.
.TP
\fCQStyle::SP_TitleBarUnshadeButton\fR - unshade button on titlebars.
.TP
\fCQStyle::SP_MessageBoxInformation\fR - the 'information' icon.
.TP
\fCQStyle::SP_MessageBoxWarning\fR - the 'warning' icon.
.TP
\fCQStyle::SP_MessageBoxCritical\fR - the 'critical' icon.
.TP
\fCQStyle::SP_MessageBoxQuestion\fR - the 'question' icon.
.TP
\fCQStyle::SP_DockWindowCloseButton\fR - close button on dock windows; see also QDockWindow.
.TP
\fCQStyle::SP_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.PP
See also stylePixmap().
.SH "QStyle::SubControl"
This enum represents a SubControl within a ComplexControl.
.TP
\fCQStyle::SC_None\fR - special value that matches no other SubControl.
.TP
\fCQStyle::SC_ScrollBarAddLine\fR - scrollbar add line (i.e. down/right arrow); see also QScrollbar.
.TP
\fCQStyle::SC_ScrollBarSubLine\fR - scrollbar sub line (i.e. up/left arrow).
\fCQStyle::SC_All\fR - special value that matches all SubControls.
.PP
See also ComplexControl.
.SH "QStyle::SubRect"
This enum represents a sub-area of a widget. Style implementations would use these areas to draw the different parts of a widget.
.TP
\fCQStyle::SR_PushButtonContents\fR - area containing the label (iconset with text or pixmap).
.TP
\fCQStyle::SR_PushButtonFocusRect\fR - area for the focus rect (usually larger than the contents rect).
.TP
\fCQStyle::SR_CheckBoxIndicator\fR - area for the state indicator (e.g. check mark).
.TP
\fCQStyle::SR_CheckBoxContents\fR - area for the label (text or pixmap).
.TP
\fCQStyle::SR_CheckBoxFocusRect\fR - area for the focus indicator.
.TP
\fCQStyle::SR_RadioButtonIndicator\fR - area for the state indicator.
.TP
\fCQStyle::SR_RadioButtonContents\fR - area for the label.
.TP
\fCQStyle::SR_RadioButtonFocusRect\fR - area for the focus indicator.
.TP
\fCQStyle::SR_ComboBoxFocusRect\fR - area for the focus indicator.
.TP
\fCQStyle::SR_SliderFocusRect\fR - area for the focus indicator.
.TP
\fCQStyle::SR_DockWindowHandleRect\fR - area for the tear-off handle.
.TP
\fCQStyle::SR_ProgressBarGroove\fR - area for the groove.
.TP
\fCQStyle::SR_ProgressBarContents\fR - area for the progress indicator.
.TP
\fCQStyle::SR_ProgressBarLabel\fR - area for the text label.
.TP
\fCQStyle::SR_ToolButtonContents\fR - area for the tool button's label.
.TP
\fCQStyle::SR_DialogButtonAccept\fR - area for a dialog's accept button.
.TP
\fCQStyle::SR_DialogButtonReject\fR - area for a dialog's reject button.
.TP
\fCQStyle::SR_DialogButtonApply\fR - area for a dialog's apply button.
.TP
\fCQStyle::SR_DialogButtonHelp\fR - area for a dialog's help button.
.TP
\fCQStyle::SR_DialogButtonAll\fR - area for a dialog's all button.
.TP
\fCQStyle::SR_DialogButtonRetry\fR - area for a dialog's retry button.
.TP
\fCQStyle::SR_DialogButtonAbort\fR - area for a dialog's abort button.
.TP
\fCQStyle::SR_DialogButtonIgnore\fR - area for a dialog's ignore button.
.TP
\fCQStyle::SR_DialogButtonCustom\fR - area for a dialog's custom widget area (in button row).
.TP
\fCQStyle::SR_ToolBoxTabContents\fR - area for a toolbox tab's icon and label
.TP
\fCQStyle::SR_CustomBase\fR - base value for custom ControlElements. All values above this are reserved for custom use. Therefore, custom values must be greater than this value.
.PP
See also subRect().
.SH MEMBER FUNCTION DOCUMENTATION
.SH "QStyle::QStyle ()"
Constructs a QStyle.
.SH "QStyle::~QStyle ()\fC [virtual]\fR"
Destroys the style and frees all allocated resources.
.SH "int QStyle::defaultFrameWidth () const"
\fBThis function is obsolete.\fR It is provided to keep old source working. We strongly advise against using it in new code.
Draws the ComplexControl \fIcontrol\fR using the painter \fIp\fR in the area \fIr\fR. Colors are used from the color group \fIcg\fR. The \fIsub\fR argument specifies which SubControls to draw. Multiple SubControls can be OR'ed together. The \fIsubActive\fR argument specifies which SubControl is active.
.PP
The rect \fIr\fR should be in logical coordinates. Reimplementations of this function should use visualRect() to change the logical coordinates into screen coordinates when using drawPrimitive() and drawControl().
.PP
The \fIhow\fR argument is used to control how the ComplexControl is drawn. Multiple flags can OR'ed together. See the table below for an explanation of which flags are used with the various ComplexControls.
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontrol\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ComplexControl. Note that \fIopt\fR may be the default value even for ComplexControls that can make use of the extra options. See the table below for the appropriate \fIwidget\fR and \fIopt\fR usage:
& Widget Cast Style Flags Notes Options Notes CC_SpinWidget(const QSpinWidget *) Style_Enabled Set if the spinwidget is enabled. Unused. Style_HasFocus Set if the spinwidget has input focus. CC_ComboBox(const QComboBox *) Style_Enabled Set if the combobox is enabled. Unused. Style_HasFocus Set if the combobox has input focus. CC_ScrollBar(const QScrollBar *) Style_Enabled Set if the scrollbar is enabled. Unused. Style_HasFocus Set if the scrollbar has input focus. CC_Slider(const QSlider *) Style_Enabled Set if the slider is enabled. Unused. Style_HasFocus Set if the slider has input focus. CC_ToolButton(const QToolButton *) Style_Enabled Set if the toolbutton is enabled. QStyleOption ( ArrowType t )
.TP
opt.arrowType() When the tool button only contains an arrow, \fIt\fR is the arrow's type. Style_HasFocus Set if the toolbutton has input focus. Style_Down Set if the toolbutton is down (ie. mouse button or space pressed). Style_On Set if the toolbutton is a toggle button and is toggled on. Style_AutoRaise Set if the toolbutton has auto-raise enabled. Style_Raised Set if the button is not down, not on and doesn't contain the mouse when auto-raise is enabled. CC_TitleBar(const QWidget *) Style_Enabled Set if the titlebar is enabled. Unused. CC_ListView(const QListView *) Style_Enabled Set if the titlebar is enabled. QStyleOption ( QListViewItem *item )
Draw a bitmask for the ComplexControl \fIcontrol\fR using the painter \fIp\fR in the area \fIr\fR. See drawComplexControl() for an explanation of the use of the \fIwidget\fR and \fIopt\fR arguments.
.PP
The rect \fIr\fR should be in logical coordinates. Reimplementations of this function should use visualRect() to change the logical corrdinates into screen coordinates when using drawPrimitive() and drawControl().
Draws the ControlElement \fIelement\fR using the painter \fIp\fR in the area \fIr\fR. Colors are used from the color group \fIcg\fR.
.PP
The rect \fIr\fR should be in screen coordinates.
.PP
The \fIhow\fR argument is used to control how the ControlElement is drawn. Multiple flags can be OR'ed together. See the table below for an explanation of which flags are used with the various ControlElements.
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIelement\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ControlElement. Note that \fIopt\fR may be the default value even for ControlElements that can make use of the extra options. See the table below for the appropriate \fIwidget\fR and \fIopt\fR usage:
CE_PushButtonLabel(const QPushButton *) Style_Enabled Set if the button is enabled. Unused. Style_HasFocus Set if the button has input focus. Style_Raised Set if the button is not down, not on and not flat. Style_On Set if the button is a toggle button and toggled on. Style_Down Set if the button is down (i.e., the mouse button or space bar is pressed on the button). Style_ButtonDefault Set if the button is a default button. CE_CheckBox(const QCheckBox *)
.PP
and
.PP
CE_CheckBoxLabel(const QCheckBox *)
.PP Style_Enabled Set if the checkbox is enabled. Unused.
Style_HasFocus Set if the checkbox has input focus. Style_On Set if the checkbox is checked. Style_Off Set if the checkbox is not checked. Style_NoChange Set if the checkbox is in the NoChange state. Style_Down Set if the checkbox is down (i.e., the mouse button or space bar is pressed on the button). CE_RadioButton(const QRadioButton *)
.PP
and
.PP
CE_RadioButtonLabel(const QRadioButton *) Style_Enabled Set if the radiobutton is enabled. Unused. Style_HasFocus Set if the radiobutton has input focus. Style_On Set if the radiobutton is checked. Style_Off Set if the radiobutton is not checked. Style_Down Set if the radiobutton is down (i.e., the mouse button or space bar is pressed on the radiobutton). CE_TabBarTab(const QTabBar *)
.PP
and
.PP
CE_TabBarLabel(const QTabBar *)
.PP Style_Enabled Set if the tabbar and tab is enabled. QStyleOption ( QTab *t )
.TP
opt.tab() \fIt\fR is the QTab being drawn. Style_Selected Set if the tab is the current tab. CE_ProgressBarGroove(const QProgressBar *)
.PP
and
.PP
CE_ProgressBarContents(const QProgressBar *)
.PP
and
.PP
CE_ProgressBarLabel(const QProgressBar *)
.PP Style_Enabled Set if the progressbar is enabled. Unused.
Style_HasFocus Set if the progressbar has input focus. CE_PopupMenuItem(const QPopupMenu *) Style_Enabled Set if the menuitem is enabled. QStyleOption ( QMenuItem *mi, int tabwidth, int maxpmwidth )
.TP
opt.menuItem()
.TP
opt.tabWidth()
.TP
opt.maxIconWidth() \fImi\fR is the menu item being drawn. QMenuItem is currently an internal class. Style_Active Set if the menuitem is the current item. \fItabwidth\fR is the width of the tab column where key accelerators are drawn. Style_Down Set if the menuitem is down (i.e., the mouse button or space bar is pressed). \fImaxpmwidth\fR is the maximum width of the check column where checkmarks and iconsets are drawn. CE_MenuBarItem(const QMenuBar *) Style_Enabled Set if the menuitem is enabled QStyleOption ( QMenuItem *mi )
.TP
opt.menuItem() \fImi\fR is the menu item being drawn. Style_Active Set if the menuitem is the current item. Style_Down Set if the menuitem is down (i.e., a mouse button or the space bar is pressed). Style_HasFocus Set if the menubar has input focus. CE_ToolButtonLabel(const QToolButton *) Style_Enabled Set if the toolbutton is enabled. QStyleOption ( ArrowType t )
.TP
opt.arrowType() When the tool button only contains an arrow, \fIt\fR is the arrow's type. Style_HasFocus Set if the toolbutton has input focus. Style_Down Set if the toolbutton is down (i.e., a mouse button or the space is pressed). Style_On Set if the toolbutton is a toggle button and is toggled on. Style_AutoRaise Set if the toolbutton has auto-raise enabled. Style_MouseOver Set if the mouse pointer is over the toolbutton. Style_Raised
Draw a bitmask for the ControlElement \fIelement\fR using the painter \fIp\fR in the area \fIr\fR. See drawControl() for an explanation of the use of the \fIwidget\fR and \fIopt\fR arguments.
Draws the \fItext\fR or \fIpixmap\fR in rectangle \fIr\fR using painter \fIp\fR and color group \fIg\fR. The pen color is specified with \fIpenColor\fR. The \fIenabled\fR bool indicates whether or not the item is enabled; when reimplementing this bool should influence how the item is drawn. If \fIlen\fR is -1 (the default) all the \fItext\fR is drawn; otherwise only the first \fIlen\fR characters of \fItext\fR are drawn. The text is aligned and wrapped according to the alignment \fIflags\fR (see Qt::AlignmentFlags).
.PP
By default, if both the text and the pixmap are not null, the pixmap is drawn and the text is ignored.
Draws the style PrimitiveElement \fIpe\fR using the painter \fIp\fR in the area \fIr\fR. Colors are used from the color group \fIcg\fR.
.PP
The rect \fIr\fR should be in screen coordinates.
.PP
The \fIflags\fR argument is used to control how the PrimitiveElement is drawn. Multiple flags can be OR'ed together.
.PP
For example, a pressed button would be drawn with the flags Style_Enabled and Style_Down.
.PP
The \fIopt\fR argument can be used to control how various PrimitiveElements are drawn. Note that \fIopt\fR may be the default value even for PrimitiveElements that make use of extra options. When \fIopt\fR is non-default, it is used as follows:
.PP
<center>.nf
.TS
l - l. PrimitiveElement Options Notes PE_FocusRect QStyleOption ( const QColor & bg )
.TP
opt.color() \fIbg\fR is the background color on which the focus rect is being drawn. PE_Panel QStyleOption ( int linewidth, int midlinewidth )
.TP
opt.lineWidth()
.TP
opt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelPopup QStyleOption ( int linewidth, int midlinewidth )
.TP
opt.lineWidth()
.TP
opt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelMenuBar QStyleOption ( int linewidth, int midlinewidth )
.TP
opt.lineWidth()
.TP
opt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_PanelDockWindow QStyleOption ( int linewidth, int midlinewidth )
.TP
opt.lineWidth()
.TP
opt.midLineWidth() \fIlinewidth\fR is the line width for drawing the panel. \fImidlinewidth\fR is the mid-line width for drawing the panel. PE_GroupBoxFrame QStyleOption ( int linewidth, int midlinewidth, int shape, int shadow )
.TP
opt.lineWidth()
.TP
opt.midLineWidth()
.TP
opt.frameShape()
.TP
opt.frameShadow() \fIlinewidth\fR is the line width for the group box. \fImidlinewidth\fR is the mid-line width for the group box. \fIshape\fR is the frame shape for the group box.
.TE
.fi
</center>
.PP
For all other PrimitiveElements, \fIopt\fR is unused.
.PP
See also StyleFlags.
.PP
Example: themes/wood.cpp.
.SH "QRect QStyle::itemRect ( QPainter * p, const QRect & r, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const\fC [virtual]\fR"
Returns the appropriate area (see below) within rectangle \fIr\fR in which to draw the \fItext\fR or \fIpixmap\fR using painter \fIp\fR. If \fIlen\fR is -1 (the default) all the \fItext\fR is drawn; otherwise only the first \fIlen\fR characters of \fItext\fR are drawn. The text is aligned in accordance with the alignment \fIflags\fR (see Qt::AlignmentFlags). The \fIenabled\fR bool indicates whether or not the item is enabled.
.PP
If \fIr\fR is larger than the area needed to render the \fItext\fR the rectangle that is returned will be offset within \fIr\fR in accordance with the alignment \fIflags\fR. For example if \fIflags\fR is AlignCenter the returned rectangle will be centered within \fIr\fR. If \fIr\fR is smaller than the area needed the rectangle that is returned will be \fIlarger\fR than \fIr\fR (the smallest rectangle large enough to render the \fItext\fR or \fIpixmap\fR).
.PP
By default, if both the text and the pixmap are not null, the pixmap is drawn and the text is ignored.
Returns the pixel metric for \fImetric\fR. The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fImetric\fR. Note that \fIwidget\fR may be zero even for PixelMetrics that can make use of \fIwidget\fR. See the table below for the appropriate \fIwidget\fR casts:
This function is called for every widget at some point after it has been fully created but just \fIbefore\fR it is shown the very first time.
.PP
Reasonable actions in this function might be to call QWidget::setBackgroundMode() for the widget. An example of highly unreasonable use would be setting the geometry! Reimplementing this function gives you a back-door through which you can change the appearance of a widget. With Qt 3.0's style engine you will rarely need to write your own polish(); instead reimplement drawItem(), drawPrimitive(), etc.
.PP
The QWidget::inherits() function may provide enough information to allow class-specific customizations. But be careful not to hard-code things too much because new QStyle subclasses are expected to work reasonably with all current and \fIfuture\fR widgets.
Polishes the popup menu according to the GUI style. This usually means setting the mouse tracking (QPopupMenu::setMouseTracking()) and whether the menu is checkable by default (QPopupMenu::setCheckable()).
Returns the SubControl for \fIwidget\fR at the point \fIpos\fR. The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontrol\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ComplexControl. Note that \fIopt\fR may be the default value even for ComplexControls that can make use of the extra options. See drawComplexControl() for an explanation of the \fIwidget\fR and \fIopt\fR arguments.
Note that \fIpos\fR is passed in screen coordinates. When using querySubControlMetrics() to check for hits and misses, use visualRect() to change the logical coordinates into screen coordinates.
.PP
See also drawComplexControl(), ComplexControl, SubControl, and querySubControlMetrics().
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontrol\fR. The \fIopt\fR argument can be used to pass extra information required when drawing the ComplexControl. Note that \fIopt\fR may be the default value even for ComplexControls that can make use of the extra options. See drawComplexControl() for an explanation of the \fIwidget\fR and \fIopt\fR arguments.
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIcontents\fR. The \fIopt\fR argument can be used to pass extra information required when calculating the size. Note that \fIopt\fR may be the default value even for ContentsTypes that can make use of the extra options. See the table below for the appropriate \fIwidget\fR and \fIopt\fR usage:
Returns the style hint \fIstylehint\fR for \fIwidget\fR. Currently, \fIwidget\fR, \fIopt\fR, and \fIreturnData\fR are unused; they're included to allow for future enhancements.
.PP
For an explanation of the return value see StyleHint.
The \fIopt\fR argument can be used to pass extra information required when drawing the ControlElement. Note that \fIopt\fR may be the default value even for StylePixmaps that can make use of the extra options. Currently, the \fIopt\fR argument is unused.
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIstylepixmap\fR. See the table below for the appropriate \fIwidget\fR casts:
Returns the sub-area \fIsubrect\fR for the \fIwidget\fR in logical coordinates.
.PP
The \fIwidget\fR argument is a pointer to a QWidget or one of its subclasses. The widget can be cast to the appropriate type based on the value of \fIsubrect\fR. See the table below for the appropriate \fIwidget\fR casts:
Undoes the initialization of a widget's appearance.
.PP
This function is the counterpart to polish. It is called for every polished widget when the style is dynamically changed. The former style has to unpolish its settings before the new style can polish them again.
Returns the rect \fIlogical\fR in screen coordinates. The bounding rect for widget \fIw\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.
This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
.PP
Returns the rect \fIlogical\fR in screen coordinates. The rect \fIbounding\fR is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.