Home | All Classes | Main Classes | Annotated | Grouped Classes | Functions

QStyle Class Reference

The QStyle class specifies the look and feel of a GUI. More...

#include <QStyle>

Inherits QObject.

Inherited by QCommonStyle.

List of all members.

Public Types

Writable Properties

Public Functions

Public Slots

Signals

Static Public Members

Protected Functions


Detailed Description

The QStyle class specifies the look and feel of a GUI.

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 "feel" options for widgets.

Although it is not possible to completely enumerate the look of graphical elements and the feel of widgets in a GUI, QStyle provides a considerable amount of control and customisability.

In Qt 1.x the look and feel option for widgets was specified by a single value: the Qt::GUIStyle. Starting with Qt 2.0, this notion was expanded to allow the look to be specified by virtual drawing functions.

Derived classes may reimplement some or all of the drawing functions to modify the look of all widgets that use those functions.

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. Start your application with -reverse to check the mirrored layout. Also notice that, for a reversed layout, the light usually comes from top right instead of the top left.

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.

In Qt versions prior to 3.0, if you wanted a low level route into changing the appearance of a widget, you had to reimplement polish(). With 3.0 and later, 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.

In Qt 4.0, the majority of the information about what is to be drawn and how it should be drawn, is specified by a QStyleOption structure. The widget parameter that was mandatory in Qt 3.0, is now optional, but it has been kept for developers who may want it. Developers who use the widget pointer must be careful and use should use qt_cast() to get the correct widget as there are no guarantees about what class the widget will be.

For information on changing elements of an existing style or creating your own style see the Style overview.

Styles can also be created as plugins.


Member Type Documentation

enum QStyle::ComplexControl

This enum represents a ComplexControl. ComplexControls have different behavior depending upon where the user clicks on them or which keys are pressed.

QStyle::CC_SpinBox 
QStyle::CC_ComboBox 
QStyle::CC_ScrollBar 
QStyle::CC_Slider 
QStyle::CC_ToolButton 
QStyle::CC_TitleBar 
QStyle::CC_ListView 
QStyle::CC_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.

See also SubControl and drawComplexControl().

enum QStyle::ContentsType

This enum represents a ContentsType. It is used to calculate sizes for the contents of various widgets.

QStyle::CT_CheckBox 
QStyle::CT_ComboBox 
QStyle::CT_DialogButtons 
QStyle::CT_DockWindow 
QStyle::CT_Header 
QStyle::CT_LineEdit 
QStyle::CT_Menu 
QStyle::CT_Menu 
QStyle::CT_MenuBar 
QStyle::CT_MenuBarItem 
QStyle::CT_MenuItem 
QStyle::CT_ProgressBar 
QStyle::CT_PushButton 
QStyle::CT_RadioButton 
QStyle::CT_SizeGrip 
QStyle::CT_Slider 
QStyle::CT_SpinBox 
QStyle::CT_Splitter 
QStyle::CT_TabBarTab 
QStyle::CT_TabWidget 
QStyle::CT_ToolButton 
QStyle::CT_ToolBarButton 
QStyle::CT_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.

See also sizeFromContents().

enum QStyle::ControlElement

This enum represents a ControlElement. A ControlElement is part of a widget that performs some action or displays information to the user.

QStyle::CE_PushButtonthe bevel and default indicator of a QPushButton.
QStyle::CE_PushButtonLabelthe label (iconset with text or pixmap) of a QPushButton.
QStyle::CE_CheckBoxthe indicator of a QCheckBox.
QStyle::CE_CheckBoxLabelthe label (text or pixmap) of a QCheckBox.
QStyle::CE_RadioButtonthe indicator of a QRadioButton.
QStyle::CE_RadioButtonLabelthe label (text or pixmap) of a QRadioButton.
QStyle::CE_TabBarTabthe tab within a QTabBar (a QTab).
QStyle::CE_TabBarLabelthe label within a QTab.
QStyle::CE_ProgressBarGroovethe groove where the progress indicator is drawn in a QProgressBar.
QStyle::CE_ProgressBarContentsthe progress indicator of a QProgressBar.
QStyle::CE_ProgressBarLabelthe text label of a QProgressBar.
QStyle::CE_ToolButtonLabela tool button's label.
QStyle::CE_ToolBarButton 
QStyle::CE_MenuBarItema menu item in a QMenuBar.
QStyle::CE_MenuBarEmptyAreathe empty area of a QMenuBar.
QStyle::CE_MenuItema menu item in a QMenu.
QStyle::CE_MenuScrollerscrolling areas in a QMenu when the style supports scrolling.
QStyle::CE_MenuTearoffa menu item representing the tear off section of a QMenu.
QStyle::CE_MenuEmptyAreathe area in a menu without menu items.
QStyle::CE_MenuVMarginthe vertical extra space on the top/bottom of a menu.
QStyle::CE_MenuHMarginthe horizontal extra space on the left/right of a menu.
QStyle::CE_DockWindowEmptyAreathe empty area of a QDockWindow.
QStyle::CE_ToolBoxTabthe toolbox's tab area.
QStyle::CE_HeaderLabelthe header's label.
QStyle::CE_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.

See also drawControl().

enum QStyle::PixelMetric

This enum represents a PixelMetric. A PixelMetric is a style dependent size represented as a single pixel value.

QStyle::PM_ButtonMarginamount of whitespace between push button labels and the frame.
QStyle::PM_ButtonDefaultIndicatorwidth of the default-button indicator frame.
QStyle::PM_MenuButtonIndicatorwidth of the menu button indicator proportional to the widget height.
QStyle::PM_ButtonShiftHorizontalhorizontal contents shift of a button when the button is down.
QStyle::PM_ButtonShiftVerticalvertical contents shift of a button when the button is down.
QStyle::PM_DefaultFrameWidthdefault frame width, usually 2.
QStyle::PM_SpinBoxFrameWidthframe width of a spin box.
QStyle::PM_MDIFrameWidthframe width of an MDI window.
QStyle::PM_MDIMinimizedWidthwidth of a minimized MDI window.
QStyle::PM_MaximumDragDistanceSome 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.
QStyle::PM_ScrollBarExtentwidth of a vertical scrollbar and the height of a horizontal scrollbar.
QStyle::PM_ScrollBarSliderMinthe minimum height of a vertical scrollbar's slider and the minimum width of a horizontal scrollbar's slider.
QStyle::PM_SliderThicknesstotal slider thickness.
QStyle::PM_SliderControlThicknessthickness of the slider handle.
QStyle::PM_SliderLengthlength of the slider.
QStyle::PM_SliderTickmarkOffsetthe offset between the tickmarks and the slider.
QStyle::PM_SliderSpaceAvailablethe available space for the slider to move.
QStyle::PM_DockWindowSeparatorExtentwidth of a separator in a horizontal dock window and the height of a separator in a vertical dock window.
QStyle::PM_DockWindowHandleExtentwidth of the handle in a horizontal dock window and the height of the handle in a vertical dock window.
QStyle::PM_DockWindowFrameWidthframe width of a dock window.
QStyle::PM_MenuBarFrameWidthframe width of a menubar.
QStyle::PM_MenuBarItemSpacingspacing between menubar items.
QStyle::PM_MenuBarHMarginspacing between menubar items and top/bottom of bar.
QStyle::PM_MenuBarVMarginspacing between menubar items and left/right of bar.
QStyle::PM_ToolBarItemSpacingspacing between toolbar items.
QStyle::PM_TabBarTabOverlapnumber of pixels the tabs should overlap.
QStyle::PM_TabBarTabHSpaceextra space added to the tab width.
QStyle::PM_TabBarTabVSpaceextra space added to the tab height.
QStyle::PM_TabBarBaseHeightheight of the area between the tab bar and the tab pages.
QStyle::PM_TabBarBaseOverlapnumber of pixels the tab bar overlaps the tab bar base.
QStyle::PM_TabBarScrollButtonWidth 
QStyle::PM_TabBarTabShiftHorizontalhorizontal pixel shift when a tab is selected.
QStyle::PM_TabBarTabShiftVerticalvertical pixel shift when a tab is selected.
QStyle::PM_ProgressBarChunkWidthwidth of a chunk in a progress bar indicator.
QStyle::PM_SplitterWidthwidth of a splitter.
QStyle::PM_TitleBarHeightheight of the title bar.
QStyle::PM_IndicatorWidthwidth of a check box indicator.
QStyle::PM_IndicatorHeightheight of a checkbox indicator.
QStyle::PM_ExclusiveIndicatorWidthwidth of a radio button indicator.
QStyle::PM_ExclusiveIndicatorHeightheight of a radio button indicator.
QStyle::PM_MenuFrameWidthborder width (applied on all sides) for a QMenu.
QStyle::PM_MenuHMarginadditional border (used on left and right) for a QMenu.
QStyle::PM_MenuVMarginadditional border (used for bottom and top) for a QMenu.
QStyle::PM_MenuScrollerHeightheight of the scroller area in a QMenu.
QStyle::PM_MenuScrollerHeightheight of the scroller area in a QMenu.
QStyle::PM_MenuTearoffHeightheight of a tear off area in a QMenu.
QStyle::PM_MenuDesktopFrameWidth 
QStyle::PM_CheckListButtonSizearea (width/height) of the checkbox/radiobutton in a QCheckListItem
QStyle::PM_CheckListControllerSizearea (width/height) of the controller in a QCheckListItem
QStyle::PM_DialogButtonsSeparatordistance between buttons in a dialog buttons widget.
QStyle::PM_DialogButtonsButtonWidthminimum width of a button in a dialog buttons widget.
QStyle::PM_DialogButtonsButtonHeightminimum height of a button in a dialog buttons widget.
QStyle::PM_HeaderMarkSize 
QStyle::PM_HeaderGripMargin 
QStyle::PM_HeaderMargin 
QStyle::PM_SpinBoxSliderHeightThe height of the optional spin box slider.
QStyle::PM_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.
QStyle::PM_DefaultToplevelMargin 
QStyle::PM_DefaultChildMargin 
QStyle::PM_DefaultLayoutSpacing 

See also pixelMetric().

enum QStyle::PixmapType

This enum represents the effects performed on a pixmap to achieve a GUI style's perferred way of representing the image in different states.

QStyle::PT_Disableda disabled pixmap (drawn on disabled widgets).
QStyle::PT_Activean active pixmap (drawn on active toolbuttons/menuitems).
QStyle::PT_CustomBasebase value for custom PixmapTypes. Custom values must be greater than this value.

See also stylePixmap().

enum QStyle::PrimitiveElement

This enum represents a style's PrimitiveElements. A PrimitiveElement is a common GUI element, such as a checkbox indicator or button bevel.

QStyle::PE_ButtonCommandbutton used to initiate an action, for example, a QPushButton.
QStyle::PE_ButtonDefaultthis button is the default button, e.g. in a dialog.
QStyle::PE_ButtonBevelgeneric button bevel.
QStyle::PE_ButtonTooltool button, for example, a QToolButton.
QStyle::PE_ButtonDropDowndrop down button, for example, a tool button that displays a popup menu, for example, QMenu.
QStyle::PE_FocusRectgeneric focus indicator.
QStyle::PE_ArrowUpup arrow.
QStyle::PE_ArrowDowndown arrow.
QStyle::PE_ArrowRightright arrow.
QStyle::PE_ArrowLeftleft arrow.
QStyle::PE_SpinBoxUpup symbol for a spin widget, for example a QSpinBox.
QStyle::PE_SpinBoxDowndown symbol for a spin widget.
QStyle::PE_SpinBoxPlusincrease symbol for a spin widget.
QStyle::PE_SpinBoxMinusdecrease symbol for a spin widget.
QStyle::PE_Indicatoron/off indicator, for example, a QCheckBox.
QStyle::PE_IndicatorMaskbitmap mask for an indicator.
QStyle::PE_ExclusiveIndicatorexclusive on/off indicator, for example, a QRadioButton.
QStyle::PE_ExclusiveIndicatorMaskbitmap mask for an exclusive indicator.
QStyle::PE_DockWindowHandletear off handle for dock windows and toolbars, for example QDockWindows and QToolBars.
QStyle::PE_DockWindowSeparatoritem separator for dock window and toolbar contents.
QStyle::PE_DockWindowResizeHandleresize handle for dock windows.
QStyle::PE_Splittersplitter handle; see also QSplitter.
QStyle::PE_Panelgeneric panel frame; see also QFrame.
QStyle::PE_PanelPopuppanel frame for popup windows/menus; see also QMenu.
QStyle::PE_PanelMenuBarpanel frame for menu bars.
QStyle::PE_PanelDockWindowpanel frame for dock windows and toolbars.
QStyle::PE_PanelTabWidgetpanel frame for tab widgets.
QStyle::PE_PanelLineEditpanel frame for line edits.
QStyle::PE_PanelGroupBoxpanel frame for group boxes.
QStyle::PE_TabBarBasearea below tabs in a tab widget, for example, QTab.
QStyle::PE_MenuFrameframe displayed in a QMenu
QStyle::PE_MenuBarFrameframe displayed in a QMenuBar
QStyle::PE_HeaderSectionsection of a list or table header; see also QHeader.
QStyle::PE_HeaderArrowarrow used to indicate sorting on a list or table header
QStyle::PE_StatusBarSectionsection of a status bar; see also QStatusBar.
QStyle::PE_GroupBoxFrameframe around a group box; see also QGroupBox.
QStyle::PE_WindowFrameframe around a MDI window or a docking window.
QStyle::PE_Separatorgeneric separator.
QStyle::PE_SizeGripwindow resize handle; see also QSizeGrip.
QStyle::PE_CheckMarkgeneric check mark; see also QCheckBox.
QStyle::PE_ScrollBarAddLinescrollbar line increase indicator. (i.e. scroll down); see also QScrollBar.
QStyle::PE_ScrollBarSubLinescrollbar line decrease indicator (i.e. scroll up).
QStyle::PE_ScrollBarAddPagescolllbar page increase indicator (i.e. page down).
QStyle::PE_ScrollBarSubPagescrollbar page decrease indicator (i.e. page up).
QStyle::PE_ScrollBarSliderscrollbar slider.
QStyle::PE_ScrollBarFirstscrollbar first line indicator (i.e. home).
QStyle::PE_ScrollBarLastscrollbar last line indicator (i.e. end).
QStyle::PE_ProgressBarChunksection of a progress bar indicator; see also QProgressBar.
QStyle::PE_CheckListControllercontroller part of a listview item.
QStyle::PE_CheckListIndicatorcheckbox part of a listview item.
QStyle::PE_CheckListExclusiveIndicatorradiobutton part of a listview item.
QStyle::PE_RubberBandrubber band used in such things as iconview.
QStyle::PE_TreeBranchlines used to represent the branch of a tree in a tree view.
QStyle::PE_SpinBoxSliderThe optional slider part of a spin box.
QStyle::PE_CustomBasebase value for custom PrimitiveElements. All values above this are reserved for custom use. Custom values must be greater than this value.

See also drawPrimitive().

enum 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.

QStyle::Style_Active 
QStyle::Style_AutoRaise 
QStyle::Style_Bottom 
QStyle::Style_ButtonDefault 
QStyle::Style_Children 
QStyle::Style_Default 
QStyle::Style_Down 
QStyle::Style_Editing 
QStyle::Style_Enabled 
QStyle::Style_FocusAtBorder 
QStyle::Style_HasFocus 
QStyle::Style_HasFocus 
QStyle::Style_Horizontal 
QStyle::Style_Item 
QStyle::Style_MouseOver 
QStyle::Style_NoChange 
QStyle::Style_Off 
QStyle::Style_On 
QStyle::Style_Open 
QStyle::Style_Raised 
QStyle::Style_Rectangle 
QStyle::Style_Selected 
QStyle::Style_Sibling 
QStyle::Style_Sunken 
QStyle::Style_Top 
QStyle::Style_Up 

See also drawPrimitive().

enum QStyle::StyleHint

This enum represents a StyleHint. A StyleHint is a general look and/or feel hint.

QStyle::SH_EtchDisabledTextdisabled text is "etched" as it is on Windows.
QStyle::SH_GUIStylethe GUI style to use.
QStyle::SH_ScrollBar_BackgroundRolethe background role for a QScrollBar.
QStyle::SH_ScrollBar_MiddleClickAbsolutePositiona boolean value. If true, middle clicking on a scrollbar causes the slider to jump to that position. If false, middle clicking is ignored.
QStyle::SH_ScrollBar_LeftClickAbsolutePositiona boolean value. If true, left clicking on a scrollbar causes the slider to jump to that position. If false, left clicking will behave as appropriate for each control.
QStyle::SH_ScrollBar_ScrollWhenPointerLeavesControla 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.
QStyle::SH_TabBar_Alignmentthe alignment for tabs in a QTabWidget. Possible values are Qt::AlignLeft, Qt::AlignCenter and Qt::AlignRight.
QStyle::SH_Header_ArrowAlignmentthe placement of the sorting indicator may appear in list or table headers. Possible values are Qt::Left or Qt::Right.
QStyle::SH_Slider_SnapToValuesliders snap to values while moving, as they do on Windows.
QStyle::SH_Slider_SloppyKeyEventskey presses handled in a sloppy manner, i.e. left on a vertical slider subtracts a line.
QStyle::SH_ProgressDialog_CenterCancelButtoncenter button on progress dialogs, like Motif, otherwise right aligned.
QStyle::SH_ProgressDialog_TextLabelAlignmentQt::Alignment -- text label alignment in progress dialogs; Center on windows, Auto|VCenter otherwise.
QStyle::SH_PrintDialog_RightAlignButtonsright align buttons in the print dialog, as done on Windows.
QStyle::SH_MainWindow_SpaceBelowMenuBar1 or 2 pixel space between the menubar and the dockarea, as done on Windows.
QStyle::SH_FontDialog_SelectAssociatedTextselect 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.
QStyle::SH_Menu_AllowActiveAndDisabledallows disabled menu items to be active.
QStyle::SH_Menu_SpaceActivatesItempressing the space bar activates the item, as done on Motif.
QStyle::SH_Menu_SubMenuPopupDelaythe number of milliseconds to wait before opening a submenu; 256 on windows, 96 on Motif.
QStyle::SH_Menu_Scrollablewhether popupmenu's must support scrolling.
QStyle::SH_Menu_SloppySubMenuswhether popupmenu's must support sloppy submenu; as implemented on Mac OS.
QStyle::SH_ScrollView_FrameOnlyAroundContentswhether scrollviews draw their frame only around contents (like Motif), or around contents, scrollbars and corner widgets (like Windows).
QStyle::SH_MenuBar_AltKeyNavigationmenubars items are navigable by pressing Alt, followed by using the arrow keys to select the desired item.
QStyle::SH_ComboBox_ListMouseTrackingmouse tracking in combobox dropdown lists.
QStyle::SH_Menu_MouseTrackingmouse tracking in popup menus.
QStyle::SH_MenuBar_MouseTrackingmouse tracking in menubars.
QStyle::SH_Menu_FillScreenWithScrollwhether scrolling popups should fill the screen as they are scrolled.
QStyle::SH_ItemView_ChangeHighlightOnFocusgray out selected items when losing focus.
QStyle::SH_Widget_ShareActivationturn on sharing activation with floating modeless dialogs.
QStyle::SH_TabBar_SelectMouseTypewhich type of mouse event should cause a tab to be selected.
QStyle::SH_ListViewExpand_SelectMouseTypewhich type of mouse event should cause a listview expansion to be selected.
QStyle::SH_TabBar_PreferNoArrowswhether a tabbar should suggest a size to prevent scoll arrows.
QStyle::SH_ComboBox_Popupallows popups as a combobox dropdown menu.
QStyle::SH_Workspace_FillSpaceOnMaximizethe workspace should maximize the client area.
QStyle::SH_TitleBar_NoBorderthe title bar has no border.
QStyle::SH_ScrollBar_StopMouseOverSliderstops auto-repeat when the slider reaches the mouse position.
QStyle::SH_BlinkCursorWhenTextSelectedwhether cursor should blink when text is selected.
QStyle::SH_RichText_FullWidthSelectionwhether richtext selections should extend to the full width of the document.
QStyle::SH_GroupBox_TextLabelVerticalAlignmenthow to vertically align a groupbox's text label.
QStyle::SH_GroupBox_TextLabelColorhow to paint a groupbox's text label.
QStyle::SH_DialogButtons_DefaultButtonwhich button gets the default status in a dialog's button widget.
QStyle::SH_ToolButton_Uses3Dindicates whether QToolButtons should use a 3D frame when the mouse is over them
QStyle::SH_ToolBox_SelectedPageTitleBoldBoldness of the selected page title in a QToolBox.
QStyle::SH_LineEdit_PasswordCharacterThe QChar Unicode character to be used for passwords.
QStyle::SH_Table_GridLineColor 
QStyle::SH_UnderlineShortcutwhether shortcuts are underlined.
QStyle::SH_SpinBox_AnimateButtonanimate a click when up or down is pressed in a spin box.
QStyle::SH_SpinBox_KeyPressAutoRepeatRateauto-repeat interval for spinbox key presses.
QStyle::SH_SpinBox_ClickAutoRepeatRateauto-repeat interval for spinbox mouse clicks.
QStyle::SH_TipLabel_OpacityAn integer indicating the opacity for the tip label, 0 is completely transparent, 255 is completely opaque.
QStyle::SH_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.

See also styleHint().

enum QStyle::StylePixmap

This enum represents a StylePixmap. A StylePixmap is a pixmap that can follow some existing GUI style or guideline.

QStyle::SP_TitleBarMinButtonminimize button on title bars. For example, in a QWorkspace.
QStyle::SP_TitleBarMaxButtonmaximize button on title bars.
QStyle::SP_TitleBarCloseButtonclose button on title bars.
QStyle::SP_TitleBarNormalButtonnormal (restore) button on title bars.
QStyle::SP_TitleBarShadeButtonshade button on title bars.
QStyle::SP_TitleBarUnshadeButtonunshade button on title bars.
QStyle::SP_MessageBoxInformationthe 'information' icon.
QStyle::SP_MessageBoxWarningthe 'warning' icon.
QStyle::SP_MessageBoxCriticalthe 'critical' icon.
QStyle::SP_MessageBoxQuestionthe 'question' icon.
QStyle::SP_DesktopIcon 
QStyle::SP_TrashIcon 
QStyle::SP_ComputerIcon 
QStyle::SP_DriveFDIcon 
QStyle::SP_DriveHDIcon 
QStyle::SP_DriveCDIcon 
QStyle::SP_DriveDVDIcon 
QStyle::SP_DriveNetIcon 
QStyle::SP_DirOpenIcon 
QStyle::SP_DirClosedIcon 
QStyle::SP_DirLinkIcon 
QStyle::SP_FileIcon 
QStyle::SP_FileLinkIcon 
QStyle::SP_DockWindowCloseButtonclose button on dock windows; see also QDockWindow.
QStyle::SP_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.

See also stylePixmap().

enum QStyle::SubControl

This enum represents a SubControl within a ComplexControl.

QStyle::SC_Nonespecial value that matches no other SubControl.
QStyle::SC_ScrollBarAddLinescrollbar add line (i.e. down/right arrow); see also QScrollbar.
QStyle::SC_ScrollBarSubLinescrollbar sub line (i.e. up/left arrow).
QStyle::SC_ScrollBarAddPagescrollbar add page (i.e. page down).
QStyle::SC_ScrollBarSubPagescrollbar sub page (i.e. page up).
QStyle::SC_ScrollBarFirstscrollbar first line (i.e. home).
QStyle::SC_ScrollBarLastscrollbar last line (i.e. end).
QStyle::SC_ScrollBarSliderscrollbar slider handle.
QStyle::SC_ScrollBarGroovespecial sub-control which contains the area in which the slider handle may move.
QStyle::SC_SpinBoxUpspinwidget up/increase; see also QSpinBox.
QStyle::SC_SpinBoxDownspinwidget down/decrease.
QStyle::SC_SpinBoxFramespinwidget frame.
QStyle::SC_SpinBoxEditFieldspinwidget edit field.
QStyle::SC_SpinBoxButtonFieldspinwidget button field.
QStyle::SC_SpinBoxSliderspinwidget optional slider.
QStyle::SC_ComboBoxEditFieldcombobox edit field; see also QComboBox.
QStyle::SC_ComboBoxArrowcombobox arrow
QStyle::SC_ComboBoxFramecombobox frame
QStyle::SC_ComboBoxListBoxPopupcombobox list box
QStyle::SC_SliderGroovespecial sub-control which contains the area in which the slider handle may move.
QStyle::SC_SliderHandleslider handle.
QStyle::SC_SliderTickmarksslider tickmarks.
QStyle::SC_ToolButtontool button; see also QToolbutton.
QStyle::SC_ToolButtonMenusub-control for opening a popup menu in a tool button; see also Q3PopupMenu.
QStyle::SC_TitleBarSysMenusystem menu button (i.e. restore, close, etc.).
QStyle::SC_TitleBarMinButtonminimize button.
QStyle::SC_TitleBarMaxButtonmaximize button.
QStyle::SC_TitleBarCloseButtonclose button.
QStyle::SC_TitleBarLabelwindow title label.
QStyle::SC_TitleBarNormalButtonnormal (restore) button.
QStyle::SC_TitleBarShadeButtonshade button.
QStyle::SC_TitleBarUnshadeButtonunshade button.
QStyle::SC_ListViewthe list view area.
QStyle::SC_ListViewExpandexpand item (i.e. show/hide child items).
QStyle::SC_Allspecial value that matches all SubControls.

See also ComplexControl.

enum QStyle::SubRect

This enum represents a sub-area of a widget. Style implementations use these areas to draw the different parts of a widget.

QStyle::SR_PushButtonContentsarea containing the label (iconset with text or pixmap).
QStyle::SR_PushButtonFocusRectarea for the focus rect (usually larger than the contents rect).
QStyle::SR_CheckBoxIndicatorarea for the state indicator (e.g. check mark).
QStyle::SR_CheckBoxContentsarea for the label (text or pixmap).
QStyle::SR_CheckBoxFocusRectarea for the focus indicator.
QStyle::SR_RadioButtonIndicatorarea for the state indicator.
QStyle::SR_RadioButtonContentsarea for the label.
QStyle::SR_RadioButtonFocusRectarea for the focus indicator.
QStyle::SR_ComboBoxFocusRectarea for the focus indicator.
QStyle::SR_SliderFocusRectarea for the focus indicator.
QStyle::SR_DockWindowHandleRectarea for the tear-off handle.
QStyle::SR_ProgressBarGroovearea for the groove.
QStyle::SR_ProgressBarContentsarea for the progress indicator.
QStyle::SR_ProgressBarLabelarea for the text label.
QStyle::SR_ToolButtonContentsarea for the tool button's label.
QStyle::SR_DialogButtonAcceptarea for a dialog's accept button.
QStyle::SR_DialogButtonRejectarea for a dialog's reject button.
QStyle::SR_DialogButtonApplyarea for a dialog's apply button.
QStyle::SR_DialogButtonHelparea for a dialog's help button.
QStyle::SR_DialogButtonAllarea for a dialog's all button.
QStyle::SR_DialogButtonRetryarea for a dialog's retry button.
QStyle::SR_DialogButtonAbortarea for a dialog's abort button.
QStyle::SR_DialogButtonIgnorearea for a dialog's ignore button.
QStyle::SR_DialogButtonCustomarea for a dialog's custom widget area (in the button row).
QStyle::SR_ToolBoxTabContentsarea for a toolbox tab's icon and label
QStyle::SR_CustomBasebase value for custom ControlElements. Custom values must be greater than this value.
QStyle::SR_ToolBarButtonContents 
QStyle::SR_ToolBarButtonMenu 

See also subRect().


Member Function Documentation

QStyle::QStyle ()

Constructs a QStyle.

QStyle::~QStyle ()   [virtual]

Destroys the style and frees all allocated resources.

void QStyle::drawComplexControl ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * widget = 0 ) const   [pure virtual]

Draws the ComplexControl cc using the painter p with the style options specified by opt.

The widget argument is optional and may contain a widget to aid in drawing cc.

The opt parameter is a pointer to a QStyleOptionComplex structure that can be qt_cast'ed to the correct structure. Note that the rect member of opt 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().

Here is a table listing the elements and what they can be cast to, along with an explaination of the flags.

Complex ControlOption CastStyle FlagsNotes
CC_SpinBox(const QStyleOptionSpinBox *)Style_EnabledSet if the spinwidget is enabled.
Style_HasFocusSet if the spinwidget has input focus.
CC_ComboBox(const QStyleOptionComboBox *)Style_EnabledSet if the combobox is enabled.
Style_HasFocusSet if the combobox has input focus.
CC_ScrollBar(const QStyleOptionSlider *)Style_EnabledSet if the scrollbar is enabled.
Style_HasFocusSet if the scrollbar has input focus.
CC_Slider(const QStyleOptionSlider *)Style_EnabledSet if the slider is enabled.
Style_HasFocusSet if the slider has input focus.
CC_ToolButton(const QStyleOptionToolButton *)Style_EnabledSet if the toolbutton is enabled.
Style_HasFocusSet if the toolbutton has input focus.
Style_DownSet if the toolbutton is down (i.e. a mouse button or the space bar is pressed).
Style_OnSet if the toolbutton is a toggle button and is toggled on.
Style_AutoRaiseSet if the toolbutton has auto-raise enabled.
Style_RaisedSet if the button is not down, not on, and doesn't contain the mouse when auto-raise is enabled.
CC_TitleBar(const QStyleOptionTitleBar *)Style_EnabledSet if the title bar is enabled.
CC_ListView(const QStyleOptionListView *)Style_EnabledSet if the listview is enabled.

See also ComplexControl, SubControl, and QStyleOptionComplex.

void QStyle::drawComplexControlMask ( ComplexControl cc, const QStyleOptionComplex * opt, QPainter * p, const QWidget * widget = 0 ) const   [pure virtual]

Draw a bitmask for the ComplexControl cc using the painter p with the style options specified by opt. See drawComplexControl() for an explanation of the use of the widget and opt arguments.

The rect int the QStyleOptionComplex opt 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().

See also drawComplexControl(), ComplexControl, and QStyleOptionComplex.

void QStyle::drawControl ( ControlElement element, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const   [pure virtual]

Draws the ControlElement element with painter p with the style options specified by opt.

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

The opt parameter can be qt_cast()'ed to the correct sub-class of the QStyleOption.

What follows is a table of the elements and the QStyleOption structure they can cast to. The flags stored in the QStyleOption state variable are also listed. If a ControlElement is not listed here, then it uses the default QStyleOption.

ControlElementOption CastStyle FlagsNotes
CE_MenuItem and CE_MenuBarItemconst QStyleOptionMenuItemStyle_ActiveThe menu item is the current item.
Style_EnabledThe item is enabled.
Style_DownSet if the menu item is down (i.e., if the mouse button or the space bar is pressed).
Style_HasFocusSet if the menubar has input focus.
CE_PushButton and CE_PushButtonLabelconst QStyleOptionButtonStyle_EnabledSet if the button is enabled.
Style_HasFocusSet if the button has input focus.
Style_RaisedSet if the button is not down, not on and not flat.
Style_OnSet if the button is a toggle button and is toggled on.
Style_DownSet if the button is down (i.e., the mouse button or the space bar is pressed on the button).
Style_ButtonDefaultSet if the button is a default button.
CE_RadioButton, CE_RadioButtonLabel, CE_CheckBox, and CE_CheckBoxLabelconst QStyleOptionButtonStyle_EnabledSet if the button is enabled.
Style_HasFocusSet if the button has input focus.
Style_OnSet if the button is checked.
Style_OffSet if the button is not checked.
Style_NoChangeSet if the button is in the NoChange state.
Style_DownSet if the button is down (i.e., the mouse button or the space bar is pressed on the button).
CE_ProgressBarContents, CE_ProgressBarLabel, CE_ProgressBarGrooveconst QStyleOptionProgressBarStyle_EnabledSet if the progressbar is enabled.
Style_HasFocusSet if the progressbar has input focus.
CE_HeaderLabelconst QStyleOptionHeader
CE_ToolButtonLabelconst QStyleOptionToolButtonStyle_EnabledSet if the toolbutton is enabled.
Style_HasFocusSet if the toolbutton has input focus.
Style_DownSet if the toolbutton is down (i.e., a mouse button or the space bar is pressed).
Style_OnSet if the toolbutton is a toggle button and is toggled on.
Style_AutoRaiseSet if the toolbutton has auto-raise enabled.
Style_MouseOverSet if the mouse pointer is over the toolbutton.
Style_RaisedSet if the button is not down and is not on.
CE_ToolBoxTabconst QStyleOptionToolBoxStyle_SelectedThe tab is the currently selected tab.

See also ControlElement, StyleFlags, and QStyleOption.

void QStyle::drawControlMask ( ControlElement element, const QStyleOption * opt, QPainter * p, const QWidget * widget = 0 ) const   [pure virtual]

Draw a bitmask for the ControlElement element using the painter p with the style options specified by opt. See drawControl() for an explanation of the use of opt and widget.

void QStyle::drawItem ( QPainter * p, const QRect & r, int flags, const QPalette & pal, bool enabled, const QString & text, int len = -1, const QColor * penColor = 0 ) const   [virtual]

Draws the text in rectangle r using painter p and palette pal. The pen color is specified with penColor. The enabled bool indicates whether or not the item is enabled; when reimplementing this bool should influence how the item is drawn. If len is -1 (the default) all the text is drawn; otherwise only the first len characters of text are drawn. The text is aligned and wrapped according to the alignment flags (see Qt::Alignment).

void QStyle::drawItem ( QPainter * p, const QRect & r, int flags, const QPalette & pal, bool enabled, const QPixmap & pixmap, const QColor * penColor = 0 ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Draws the pixmap in rectangle r using painter p and the palette pal.

void QStyle::drawItem ( QPainter * p, const QRect & r, int flags, const QPalette & pal, bool enabled, const QPixmap & pixmap, const QString & text, int len = -1, const QColor * penColor = 0 ) const

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Draws the pixmap in rectangle r using painter p and palette pal.

void QStyle::drawPrimitive ( PrimitiveElement pe, const QStyleOption * opt, QPainter * p, const QWidget * w = 0 ) const   [pure virtual]

Draw the primitive option pe with painter p using the style options specified by opt.

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

The opt parameter can be qt_cast()'ed to the correct sub-class of the QStyleOption.

What follows is a table of the elements and the QStyleOption structure they can be cast to. The flags stored in the QStyleOption state variable are also listed. If a PrimitiveElement is not listed here, then it uses the default QStyleOption.

The QStyleOption is the the following for the following types of PrimitiveElements.

PrimitiveElementOption CastStyle FlagsNotes
PE_FocusRect(const QStyleOptionFocusRect *)Style_FocusAtBorderWhether the focus is is at the border or inside the widget.
PE_Indicator(const QStyleOptionButton *)Sytle_NoChangeIndicates a "tri-state" checkbox.
Style_OnIndicates the indicator is checked.
PE_ExclusiveIndicator(const QStyleOptionButton *)Style_OnIndicates that a radiobutton is selected.
PE_CheckListExclusiveIndicator and PE_CheckListIndicator(const QStyleOptionListView *)Style_OnIndicates whether or not the controller is selected.
Style_NoChangeIndicates a "tri-state" controller.
Style_EnableIndicates the controller is enabled.
PE_TreeBranch(const QStyleOption *)Style_DownIndicates that the Tree Branch is pressed
Style_OpenIndicates that the tree branch is expanded.
PE_HeaderArrow(const QStyleOptionHeader *)Style_UpIndicates that the arrow should be drawn up; otherwise it should be down.
PE_HeaderSection(const QStyleOptionHeader *)Style_SunkenIndicates that the section is pressed.
Style_UpIndicates that the sort indicator should be pointing up.
Style_OffIndicates that the the section is not selected.
PE_PanelGroupBox, PE_Panel, PE_PanelLineEdit, PE_PanelPopup, and PE_PanelDockWindow(const QStyleOptionFrame *)Style_SunkenIndicates that the Frame should be sunken.
PE_DockWindowHandle(const QStyleOptionDockWindow *)Style_HorizontalIndicates that the window handle is horizontal instead of vertical.
PE_DockWindowSeparator(const QStyleOption *)Style_HorizontalIndicates that the separator is horizontal instead of vertical.
PE_SpinBoxPlus, PE_SpinBoxMinus, PE_SpinBoxUp, PE_SpinBoxDown, and PE_SpinBoxSlider(const QStyleOptionSpinBox *)Style_SunkenIndicates that the button is pressed.

See also PrimitiveElement, StyleFlags, and QStyleOption.

QRect QStyle::itemRect ( const QFontMetrics & fm, const QRect & r, int flags, bool enabled, const QString & text, int len = -1 ) const   [virtual]

Returns the appropriate area (see below) within rectangle r in which to draw text using the font metrics fm. If len is -1 (the default) all the text is drawn; otherwise only the first len characters of text are drawn. The text is aligned in accordance with the alignment flags (see Qt::Alignment). The enabled bool indicates whether or not the item is enabled.

If r is larger than the area needed to render the text the rectangle that is returned will be offset within r in accordance with the alignment flags. For example if flags is Qt::AlignCenter the returned rectangle will be centered within r. If r is smaller than the area needed the rectangle that is returned will be larger than r (the smallest rectangle large enough to render the text).

QRect QStyle::itemRect ( QPainter * p, const QRect & r, int flags, bool enabled, const QPixmap & pixmap, const QString & text, int len = -1 ) const

This function is obsolete. It is provided to keep old source code working. We strongly advise against using it in new code.

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the appropriate area within rectangle r in which to draw the pixmap and text using the painter p. The flags determine the pixmap's alignment.

QRect QStyle::itemRect ( const QRect & r, int flags, const QPixmap & pixmap ) const   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the appropriate area within rectangle r in which to draw the pixmap. The flags determine the pixmap's alignment.

int QStyle::pixelMetric ( PixelMetric metric, const QWidget * widget = 0 ) const   [pure virtual]

Warning: This function will be replaced in Qt 4.0

The functionality will be replaced by a new pixelMetric() that is not dependent on the widget argument.

Returns the pixel metric for the given metric. The widget 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 metric. Note that widget may be zero even for PixelMetrics that can make use of widget. See the table below for the appropriate widget casts:

PixelMetricWidget Cast
PM_SliderControlThickness(const QSlider *)
PM_SliderLength(const QSlider *)
PM_SliderTickmarkOffset(const QSlider *)
PM_SliderSpaceAvailable(const QSlider *)
PM_TabBarTabOverlap(const QTabBar *)
PM_TabBarTabHSpace(const QTabBar *)
PM_TabBarTabVSpace(const QTabBar *)
PM_TabBarBaseHeight(const QTabBar *)
PM_TabBarBaseOverlap(const QTabBar *)

void QStyle::polish ( QWidget * w )   [virtual]

Initializes the appearance of widget w.

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.

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 4.0's style engine you will rarely need to write your own polish(); instead reimplement drawItem(), drawPrimitive(), etc.

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 future widgets.

See also unPolish().

void QStyle::polish ( QApplication * app )   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Late initialization of the QApplication object app.

See also unPolish().

void QStyle::polish ( QPalette & pal )   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

The style may have certain requirements for color palettes. In this function it has the chance to change the palette pal according to these requirements.

See also QPalette and QApplication::setPalette().

int QStyle::positionFromValue ( int min, int max, int logical_val, int span, bool upsideDown = false )   [static]

Converts logical_val to a pixel position. min 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 span is <= 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 upsideDown to true to reverse this behavior.

See also valueFromPosition().

SubControl QStyle::querySubControl ( ComplexControl cc, const QStyleOptionComplex * opt, const QPoint & pos, const QWidget * widget = 0 ) const   [pure virtual]

Returns the SubControl in the ComplexControl cc with the style options specified by opt at the point pos. The opt argument is a pointer to a QStyleOptionComplex structure or one of its subclasses. The structure can be cast to the appropriate type based on the value of cc. The widget argument is optional and can contain additional information for the functions. See drawComplexControl() for an explanation of the widget and opt arguments.

Note that pos is passed in screen coordinates. When using querySubControlMetrics() to check for hits and misses, use visualRect() to change the logical coordinates into screen coordinates.

See also drawComplexControl(), ComplexControl, SubControl, querySubControlMetrics(), and QStyleOptionComplex.

QRect QStyle::querySubControlMetrics ( ComplexControl cc, const QStyleOptionComplex * opt, SubControl sc, const QWidget * widget = 0 ) const   [pure virtual]

Returns the rect for the SubControl sc in the ComplexControl cc, with the style options specified by opt in logical coordinates.

The opt argument is a pointer to a QStyleOptionComplex or one of its subclasses. The structure can be cast to the appropriate type based on the value of cc. The widget is optional and can contain additional information for the function. See drawComplexControl() for an explanation of the widget and opt arguments.

See also drawComplexControl(), ComplexControl, SubControl, and QStyleOptionComplex.

QSize QStyle::sizeFromContents ( ContentsType ct, const QStyleOption * opt, const QSize & contentsSize, const QFontMetrics & fm, const QWidget * w = 0 ) const   [pure virtual]

Returns the size of styled object described in opt based on the contents size contentsSize. The font metrics in fm can aid in determining the size.

The opt argument is a pointer to a QStyleOption or one of its subclasses. The opt can be cast to the appropriate type based on the value of ct. The widget w is optional argument and can contain extra information used for calculating the size. See the table below for the appropriate opt usage:

ContentsTypeOption Cast
CT_PushButton(const QStyleOptionButton *)
CT_CheckBox(const QStyleOptionButton *)
CT_RadioButton(const QStyleOptionButton *)
CT_ToolButton(const QStyleOptionToolButton *)
CT_ComboBox(const QStyleOptionComboBox *)
CT_Splitter(const QStyleOption *)
CT_DockWindow(const QStyleOptionDockWindow *)
CT_ProgressBar(const QStyleOptionProgressBar *)
CT_MenuItem(const QStyleOptionMenuItem *)

See also ContentsType and QStyleOption.

int QStyle::styleHint ( StyleHint stylehint, const QWidget * widget = 0, const Q3StyleOption & opt = Q3StyleOption::Default, QStyleHintReturn * returnData = 0 ) const   [pure virtual]

Warning: This function will be replaced in Qt 4.0

The functionality will be replaced by a new styleHint() that is not dependent on the widget argument nor on opt.

Returns the style hint stylehint for widget. Currently, widget, opt, and returnData are unused; they're included to allow for future enhancements.

For an explanation of the return value see StyleHint.

QPixmap QStyle::stylePixmap ( StylePixmap stylepixmap, const QWidget * widget = 0, const Q3StyleOption & opt = Q3StyleOption::Default ) const   [pure virtual]

Returns a pixmap for stylepixmap.

The opt argument can be used to pass extra information required when drawing the ControlElement. Note that opt may be the default value even for StylePixmaps that can make use of the extra options. Currently, the opt argument is unused.

The widget 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 stylepixmap. See the table below for the appropriate widget casts:

StylePixmapWidget Cast
SP_TitleBarMinButton(const QWidget *)
SP_TitleBarMaxButton(const QWidget *)
SP_TitleBarCloseButton(const QWidget *)
SP_TitleBarNormalButton(const QWidget *)
SP_TitleBarShadeButton(const QWidget *)
SP_TitleBarUnshadeButton(const QWidget *)
SP_DockWindowCloseButton(const QDockWindow *)

See also StylePixmap.

QPixmap QStyle::stylePixmap ( PixmapType pixmaptype, const QPixmap & pixmap, const QPalette & pal, const Q3StyleOption & opt = Q3StyleOption::Default ) const   [pure virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns a pixmap styled to conform to pixmaptype description out of pixmap, and taking into account the palette specified by pal.

The opt argument can be used to pass extra information required when drawing the ControlElement. Note that opt may be the default value even for StylePixmaps that can make use of the extra options. Currently, the opt argument is unused.

Not all types of pixmaps will change from their input in which case the result will simply be the pixmap passed in.

QRect QStyle::subRect ( SubRect subrect, const QStyleOption * opt, const QWidget * widget = 0 ) const   [pure virtual]

Returns the sub-area subrect as described in opt in logical coordinates.

The widget argument is optional and may contain a widget that may aid determining the subRect.

The QStyleOption can be qt_cast()'d to the appropriate type based on the value of subrect. See the table below for the appropriate widget casts:

SubRectWidget Cast
SR_PushButtonContents(const QStyleOptionButton *)
SR_PushButtonFocusRect(const QStyleOptionButton *)
SR_CheckBoxIndicator(const QStyleOptionButton *)
SR_CheckBoxContents(const QStyleOptionButton *)
SR_CheckBoxFocusRect(const QStyleOptionButton *)
SR_RadioButtonIndicator(const QStyleOptionButton *)
SR_RadioButtonContents(const QStyleOptionButton *)
SR_RadioButtonFocusRect(const QStyleOptionButton *)
SR_ComboBoxFocusRect(const QStyleOptionComboBox *)
SR_DockWindowHandleRect(const QStyleOptionDockWindow *)
SR_ProgressBarGroove(const QStyleOptionProgressBar *)
SR_ProgressBarContents(const QStyleOptionProgressBar *)
SR_ProgressBarLabel(const QStyleOptionProgressBar *)

See also SubRect and QStyleOption.

void QStyle::unPolish ( QWidget * w )   [virtual]

Undoes the initialization of widget w's appearance.

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.

See also polish().

void QStyle::unPolish ( QApplication * app )   [virtual]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Undoes the polish of application app.

See also polish().

int QStyle::valueFromPosition ( int min, int max, int pos, int span, bool upsideDown = false )   [static]

Converts the pixel position pos to a value. 0 maps to min, 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 upsideDown to true to reverse this behavior.

See also positionFromValue().

QPoint QStyle::visualPos ( const QPoint & logical, const QWidget * w )   [static]

Returns the logical point in screen coordinates. The bounding rect for widget w is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.

See also QApplication::reverseLayout().

QPoint QStyle::visualPos ( const QPoint & logical, const QRect & bounding )   [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the logical point in screen coordinates. The bounding rectangle is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.

See also QApplication::reverseLayout().

QRect QStyle::visualRect ( const QRect & logical, const QWidget * w )   [static]

Returns the rect logical in screen coordinates. The bounding rect for widget w is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.

See also QApplication::reverseLayout().

QRect QStyle::visualRect ( const QRect & logical, const QRect & bounding )   [static]

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Returns the rect logical in screen coordinates. The rect bounding is used to perform the translation. This function is provided to aid style implementors in supporting right-to-left mode.

See also QApplication::reverseLayout().


Copyright © 2004 Trolltech. Trademarks
Qt 4.0.0-tp1