[190] | 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
---|
| 2 | <!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/kernel/qstyle.cpp:306 -->
|
---|
| 3 | <html>
|
---|
| 4 | <head>
|
---|
| 5 | <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
|
---|
| 6 | <title>QStyle Class</title>
|
---|
| 7 | <style type="text/css"><!--
|
---|
| 8 | fn { margin-left: 1cm; text-indent: -1cm; }
|
---|
| 9 | a:link { color: #004faf; text-decoration: none }
|
---|
| 10 | a:visited { color: #672967; text-decoration: none }
|
---|
| 11 | body { background: #ffffff; color: black; }
|
---|
| 12 | --></style>
|
---|
| 13 | </head>
|
---|
| 14 | <body>
|
---|
| 15 |
|
---|
| 16 | <table border="0" cellpadding="0" cellspacing="0" width="100%">
|
---|
| 17 | <tr bgcolor="#E5E5E5">
|
---|
| 18 | <td valign=center>
|
---|
| 19 | <a href="index.html">
|
---|
| 20 | <font color="#004faf">Home</font></a>
|
---|
| 21 | | <a href="classes.html">
|
---|
| 22 | <font color="#004faf">All Classes</font></a>
|
---|
| 23 | | <a href="mainclasses.html">
|
---|
| 24 | <font color="#004faf">Main Classes</font></a>
|
---|
| 25 | | <a href="annotated.html">
|
---|
| 26 | <font color="#004faf">Annotated</font></a>
|
---|
| 27 | | <a href="groups.html">
|
---|
| 28 | <font color="#004faf">Grouped Classes</font></a>
|
---|
| 29 | | <a href="functions.html">
|
---|
| 30 | <font color="#004faf">Functions</font></a>
|
---|
| 31 | </td>
|
---|
| 32 | <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QStyle Class Reference</h1>
|
---|
| 33 |
|
---|
| 34 | <p>The QStyle class specifies the look and feel of a GUI.
|
---|
| 35 | <a href="#details">More...</a>
|
---|
| 36 | <p><tt>#include <<a href="qstyle-h.html">qstyle.h</a>></tt>
|
---|
| 37 | <p>Inherits <a href="qobject.html">QObject</a>.
|
---|
| 38 | <p>Inherited by <a href="qcommonstyle.html">QCommonStyle</a>.
|
---|
| 39 | <p><a href="qstyle-members.html">List of all member functions.</a>
|
---|
| 40 | <h2>Public Members</h2>
|
---|
| 41 | <ul>
|
---|
| 42 | <li class=fn><a href="#QStyle"><b>QStyle</b></a> ()</li>
|
---|
| 43 | <li class=fn>virtual <a href="#~QStyle"><b>~QStyle</b></a> ()</li>
|
---|
| 44 | <li class=fn>virtual void <a href="#polish"><b>polish</b></a> ( QWidget * )</li>
|
---|
| 45 | <li class=fn>virtual void <a href="#unPolish"><b>unPolish</b></a> ( QWidget * )</li>
|
---|
| 46 | <li class=fn>virtual void <a href="#polish-2"><b>polish</b></a> ( QApplication * )</li>
|
---|
| 47 | <li class=fn>virtual void <a href="#unPolish-2"><b>unPolish</b></a> ( QApplication * )</li>
|
---|
| 48 | <li class=fn>virtual void <a href="#polish-3"><b>polish</b></a> ( QPalette & )</li>
|
---|
| 49 | <li class=fn>virtual void <a href="#polishPopupMenu"><b>polishPopupMenu</b></a> ( QPopupMenu * ) = 0</li>
|
---|
| 50 | <li class=fn>virtual QRect <a href="#itemRect"><b>itemRect</b></a> ( QPainter * p, const QRect & r, int flags, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1 ) const</li>
|
---|
| 51 | <li class=fn>virtual void <a href="#drawItem"><b>drawItem</b></a> ( QPainter * p, const QRect & r, int flags, const QColorGroup & g, bool enabled, const QPixmap * pixmap, const QString & text, int len = -1, const QColor * penColor = 0 ) const</li>
|
---|
| 52 | <li class=fn>enum <a href="#PrimitiveElement-enum"><b>PrimitiveElement</b></a> { PE_ButtonCommand, PE_ButtonDefault, PE_ButtonBevel, PE_ButtonTool, PE_ButtonDropDown, PE_FocusRect, PE_ArrowUp, PE_ArrowDown, PE_ArrowRight, PE_ArrowLeft, PE_SpinWidgetUp, PE_SpinWidgetDown, PE_SpinWidgetPlus, PE_SpinWidgetMinus, PE_Indicator, PE_IndicatorMask, PE_ExclusiveIndicator, PE_ExclusiveIndicatorMask, PE_DockWindowHandle, PE_DockWindowSeparator, PE_DockWindowResizeHandle, PE_Splitter, PE_Panel, PE_PanelPopup, PE_PanelMenuBar, PE_PanelDockWindow, PE_TabBarBase, PE_HeaderSection, PE_HeaderArrow, PE_StatusBarSection, PE_GroupBoxFrame, PE_Separator, PE_SizeGrip, PE_CheckMark, PE_ScrollBarAddLine, PE_ScrollBarSubLine, PE_ScrollBarAddPage, PE_ScrollBarSubPage, PE_ScrollBarSlider, PE_ScrollBarFirst, PE_ScrollBarLast, PE_ProgressBarChunk, PE_PanelLineEdit, PE_PanelTabWidget, PE_WindowFrame, PE_CheckListController, PE_CheckListIndicator, PE_CheckListExclusiveIndicator, PE_PanelGroupBox, PE_RubberBand, PE_CustomBase = 0xf000000 }</li>
|
---|
| 53 | <li class=fn>enum <a href="#StyleFlags-enum"><b>StyleFlags</b></a> { Style_Default = 0x00000000, Style_Enabled = 0x00000001, Style_Raised = 0x00000002, Style_Sunken = 0x00000004, Style_Off = 0x00000008, Style_NoChange = 0x00000010, Style_On = 0x00000020, Style_Down = 0x00000040, Style_Horizontal = 0x00000080, Style_HasFocus = 0x00000100, Style_Top = 0x00000200, Style_Bottom = 0x00000400, Style_FocusAtBorder = 0x00000800, Style_AutoRaise = 0x00001000, Style_MouseOver = 0x00002000, Style_Up = 0x00004000, Style_Selected = 0x00008000, Style_Active = 0x00010000, Style_ButtonDefault = 0x00020000 }</li>
|
---|
| 54 | <li class=fn>virtual void <a href="#drawPrimitive"><b>drawPrimitive</b></a> ( PrimitiveElement pe, QPainter * p, const QRect & r, const QColorGroup & cg, SFlags flags = Style_Default, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 55 | <li class=fn>enum <a href="#ControlElement-enum"><b>ControlElement</b></a> { CE_PushButton, CE_PushButtonLabel, CE_CheckBox, CE_CheckBoxLabel, CE_RadioButton, CE_RadioButtonLabel, CE_TabBarTab, CE_TabBarLabel, CE_ProgressBarGroove, CE_ProgressBarContents, CE_ProgressBarLabel, CE_PopupMenuItem, CE_MenuBarItem, CE_ToolButtonLabel, CE_MenuBarEmptyArea, CE_PopupMenuScroller, CE_DockWindowEmptyArea, CE_PopupMenuVerticalExtra, CE_PopupMenuHorizontalExtra, CE_ToolBoxTab, CE_HeaderLabel, CE_CustomBase = 0xf0000000 }</li>
|
---|
| 56 | <li class=fn>virtual void <a href="#drawControl"><b>drawControl</b></a> ( ControlElement element, QPainter * p, const QWidget * widget, const QRect & r, const QColorGroup & cg, SFlags how = Style_Default, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 57 | <li class=fn>virtual void <a href="#drawControlMask"><b>drawControlMask</b></a> ( ControlElement element, QPainter * p, const QWidget * widget, const QRect & r, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 58 | <li class=fn>enum <a href="#SubRect-enum"><b>SubRect</b></a> { SR_PushButtonContents, SR_PushButtonFocusRect, SR_CheckBoxIndicator, SR_CheckBoxContents, SR_CheckBoxFocusRect, SR_RadioButtonIndicator, SR_RadioButtonContents, SR_RadioButtonFocusRect, SR_ComboBoxFocusRect, SR_SliderFocusRect, SR_DockWindowHandleRect, SR_ProgressBarGroove, SR_ProgressBarContents, SR_ProgressBarLabel, SR_ToolButtonContents, SR_DialogButtonAccept, SR_DialogButtonReject, SR_DialogButtonApply, SR_DialogButtonHelp, SR_DialogButtonAll, SR_DialogButtonAbort, SR_DialogButtonIgnore, SR_DialogButtonRetry, SR_DialogButtonCustom, SR_ToolBoxTabContents, SR_CustomBase = 0xf0000000 }</li>
|
---|
| 59 | <li class=fn>virtual QRect <a href="#subRect"><b>subRect</b></a> ( SubRect subrect, const QWidget * widget ) const = 0</li>
|
---|
| 60 | <li class=fn>enum <a href="#ComplexControl-enum"><b>ComplexControl</b></a> { CC_SpinWidget, CC_ComboBox, CC_ScrollBar, CC_Slider, CC_ToolButton, CC_TitleBar, CC_ListView, CC_CustomBase = 0xf0000000 }</li>
|
---|
| 61 | <li class=fn>enum <a href="#SubControl-enum"><b>SubControl</b></a> { 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_SpinWidgetUp = 0x00000001, SC_SpinWidgetDown = 0x00000002, SC_SpinWidgetFrame = 0x00000004, SC_SpinWidgetEditField = 0x00000008, SC_SpinWidgetButtonField = 0x00000010, 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_TitleBarLabel = 0x00000001, SC_TitleBarSysMenu = 0x00000002, SC_TitleBarMinButton = 0x00000004, SC_TitleBarMaxButton = 0x00000008, SC_TitleBarCloseButton = 0x00000010, SC_TitleBarNormalButton = 0x00000020, SC_TitleBarShadeButton = 0x00000040, SC_TitleBarUnshadeButton = 0x00000080, SC_ListView = 0x00000001, SC_ListViewBranch = 0x00000002, SC_ListViewExpand = 0x00000004, SC_All = 0xffffffff }</li>
|
---|
| 62 | <li class=fn>virtual void <a href="#drawComplexControl"><b>drawComplexControl</b></a> ( ComplexControl control, QPainter * p, const QWidget * widget, const QRect & r, const QColorGroup & cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 63 | <li class=fn>virtual void <a href="#drawComplexControlMask"><b>drawComplexControlMask</b></a> ( ComplexControl control, QPainter * p, const QWidget * widget, const QRect & r, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 64 | <li class=fn>virtual QRect <a href="#querySubControlMetrics"><b>querySubControlMetrics</b></a> ( ComplexControl control, const QWidget * widget, SubControl subcontrol, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 65 | <li class=fn>virtual SubControl <a href="#querySubControl"><b>querySubControl</b></a> ( ComplexControl control, const QWidget * widget, const QPoint & pos, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 66 | <li class=fn>enum <a href="#PixelMetric-enum"><b>PixelMetric</b></a> { PM_ButtonMargin, PM_ButtonDefaultIndicator, PM_MenuButtonIndicator, PM_ButtonShiftHorizontal, PM_ButtonShiftVertical, PM_DefaultFrameWidth, PM_SpinBoxFrameWidth, PM_MaximumDragDistance, PM_ScrollBarExtent, PM_ScrollBarSliderMin, PM_SliderThickness, PM_SliderControlThickness, PM_SliderLength, PM_SliderTickmarkOffset, PM_SliderSpaceAvailable, PM_DockWindowSeparatorExtent, PM_DockWindowHandleExtent, PM_DockWindowFrameWidth, PM_MenuBarFrameWidth, PM_TabBarTabOverlap, PM_TabBarTabHSpace, PM_TabBarTabVSpace, PM_TabBarBaseHeight, PM_TabBarBaseOverlap, PM_ProgressBarChunkWidth, PM_SplitterWidth, PM_TitleBarHeight, PM_IndicatorWidth, PM_IndicatorHeight, PM_ExclusiveIndicatorWidth, PM_ExclusiveIndicatorHeight, PM_PopupMenuScrollerHeight, PM_CheckListButtonSize, PM_CheckListControllerSize, PM_PopupMenuFrameHorizontalExtra, PM_PopupMenuFrameVerticalExtra, PM_DialogButtonsSeparator, PM_DialogButtonsButtonWidth, PM_DialogButtonsButtonHeight, PM_MDIFrameWidth, PM_MDIMinimizedWidth, PM_HeaderMargin, PM_HeaderMarkSize, PM_HeaderGripMargin, PM_TabBarTabShiftHorizontal, PM_TabBarTabShiftVertical, PM_TabBarScrollButtonWidth, PM_MenuBarItemSpacing, PM_ToolBarItemSpacing, PM_CustomBase = 0xf0000000 }</li>
|
---|
| 67 | <li class=fn>virtual int <a href="#pixelMetric"><b>pixelMetric</b></a> ( PixelMetric metric, const QWidget * widget = 0 ) const = 0</li>
|
---|
| 68 | <li class=fn>enum <a href="#ContentsType-enum"><b>ContentsType</b></a> { CT_PushButton, CT_CheckBox, CT_RadioButton, CT_ToolButton, CT_ComboBox, CT_Splitter, CT_DockWindow, CT_ProgressBar, CT_PopupMenuItem, CT_TabBarTab, CT_Slider, CT_Header, CT_LineEdit, CT_MenuBar, CT_SpinBox, CT_SizeGrip, CT_TabWidget, CT_DialogButtons, CT_CustomBase = 0xf0000000 }</li>
|
---|
| 69 | <li class=fn>virtual QSize <a href="#sizeFromContents"><b>sizeFromContents</b></a> ( ContentsType contents, const QWidget * widget, const QSize & contentsSize, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 70 | <li class=fn>enum <a href="#StyleHint-enum"><b>StyleHint</b></a> { SH_EtchDisabledText, SH_GUIStyle, SH_ScrollBar_BackgroundMode, 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_PopupMenu_AllowActiveAndDisabled, SH_PopupMenu_SpaceActivatesItem, SH_PopupMenu_SubMenuPopupDelay, SH_ScrollView_FrameOnlyAroundContents, SH_MenuBar_AltKeyNavigation, SH_ComboBox_ListMouseTracking, SH_PopupMenu_MouseTracking, SH_MenuBar_MouseTracking, SH_ItemView_ChangeHighlightOnFocus, SH_Widget_ShareActivation, SH_Workspace_FillSpaceOnMaximize, SH_ComboBox_Popup, SH_TitleBar_NoBorder, SH_ScrollBar_StopMouseOverSlider, SH_BlinkCursorWhenTextSelected, SH_RichText_FullWidthSelection, SH_PopupMenu_Scrollable, SH_GroupBox_TextLabelVerticalAlignment, SH_GroupBox_TextLabelColor, SH_PopupMenu_SloppySubMenus, SH_Table_GridLineColor, SH_LineEdit_PasswordCharacter, SH_DialogButtons_DefaultButton, SH_ToolBox_SelectedPageTitleBold, SH_TabBar_PreferNoArrows, SH_ScrollBar_LeftClickAbsolutePosition, SH_ListViewExpand_SelectMouseType, SH_UnderlineAccelerator, SH_ToolButton_Uses3D, SH_CustomBase = 0xf0000000 }</li>
|
---|
| 71 | <li class=fn>virtual int <a href="#styleHint"><b>styleHint</b></a> ( StyleHint stylehint, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default, QStyleHintReturn * returnData = 0 ) const = 0</li>
|
---|
| 72 | <li class=fn>enum <a href="#StylePixmap-enum"><b>StylePixmap</b></a> { SP_TitleBarMinButton, SP_TitleBarMaxButton, SP_TitleBarCloseButton, SP_TitleBarNormalButton, SP_TitleBarShadeButton, SP_TitleBarUnshadeButton, SP_DockWindowCloseButton, SP_MessageBoxInformation, SP_MessageBoxWarning, SP_MessageBoxCritical, SP_MessageBoxQuestion, SP_CustomBase = 0xf0000000 }</li>
|
---|
| 73 | <li class=fn>virtual QPixmap <a href="#stylePixmap"><b>stylePixmap</b></a> ( StylePixmap stylepixmap, const QWidget * widget = 0, const QStyleOption & opt = QStyleOption::Default ) const = 0</li>
|
---|
| 74 | <li class=fn>int defaultFrameWidth () const <em>(obsolete)</em></li>
|
---|
| 75 | <li class=fn>void tabbarMetrics ( const QWidget * t, int & hf, int & vf, int & ov ) const <em>(obsolete)</em></li>
|
---|
| 76 | <li class=fn>QSize scrollBarExtent () const <em>(obsolete)</em></li>
|
---|
| 77 | </ul>
|
---|
| 78 | <h2>Static Public Members</h2>
|
---|
| 79 | <ul>
|
---|
| 80 | <li class=fn>QRect <a href="#visualRect"><b>visualRect</b></a> ( const QRect & logical, const QWidget * w )</li>
|
---|
| 81 | <li class=fn>QRect <a href="#visualRect-2"><b>visualRect</b></a> ( const QRect & logical, const QRect & bounding )</li>
|
---|
| 82 | </ul>
|
---|
| 83 | <hr><a name="details"></a><h2>Detailed Description</h2>
|
---|
| 84 |
|
---|
| 85 |
|
---|
| 86 | The QStyle class specifies the look and feel of a GUI.
|
---|
| 87 |
|
---|
| 88 | <p> A large number of GUI elements are common to many widgets. The
|
---|
| 89 | QStyle class allows the look of these elements to be modified
|
---|
| 90 | across all widgets that use the QStyle functions. It also
|
---|
| 91 | provides two feel options: <a href="motif-extension.html#Motif">Motif</a> and Windows.
|
---|
| 92 | <p> Although it is not possible to fully enumerate the look of
|
---|
| 93 | graphical elements and the feel of widgets in a GUI, QStyle
|
---|
| 94 | provides a considerable amount of control and customisability.
|
---|
| 95 | <p> In Qt 1.x the look and feel option for widgets was specified by a
|
---|
| 96 | single value: the GUIStyle. Starting with Qt 2.0, this notion was
|
---|
| 97 | expanded to allow the look to be specified by virtual drawing
|
---|
| 98 | functions.
|
---|
| 99 | <p> Derived classes may reimplement some or all of the drawing
|
---|
| 100 | functions to modify the look of all widgets that use those
|
---|
| 101 | functions.
|
---|
| 102 | <p> Languages written from right to left (such as Arabic and Hebrew)
|
---|
| 103 | usually also mirror the whole layout of widgets. If you design a
|
---|
| 104 | style, you should take special care when drawing asymmetric
|
---|
| 105 | elements to make sure that they also look correct in a mirrored
|
---|
| 106 | layout. You can start your application with <tt>-reverse</tt> to check
|
---|
| 107 | the mirrored layout. Also notice, that for a reversed layout, the
|
---|
| 108 | light usually comes from top right instead of top left.
|
---|
| 109 | <p> The actual reverse layout is performed automatically when
|
---|
| 110 | possible. However, for the sake of flexibility, the translation
|
---|
| 111 | cannot be performed everywhere. The documentation for each
|
---|
| 112 | function in the QStyle API states whether the function
|
---|
| 113 | expects/returns logical or screen coordinates. Using logical
|
---|
| 114 | coordinates (in ComplexControls, for example) provides great
|
---|
| 115 | flexibility in controlling the look of a widget. Use <a href="#visualRect">visualRect</a>()
|
---|
| 116 | when necessary to translate logical coordinates into screen
|
---|
| 117 | coordinates for drawing.
|
---|
| 118 | <p> In Qt versions prior to 3.0, if you wanted a low level route into
|
---|
| 119 | changing the appearance of a widget, you would reimplement
|
---|
| 120 | <a href="#polish">polish</a>(). With the new 3.0 style engine the recommended approach
|
---|
| 121 | is to reimplement the draw functions, for example <a href="#drawItem">drawItem</a>(),
|
---|
| 122 | <a href="#drawPrimitive">drawPrimitive</a>(), <a href="#drawControl">drawControl</a>(), <a href="#drawControlMask">drawControlMask</a>(),
|
---|
| 123 | <a href="#drawComplexControl">drawComplexControl</a>() and <a href="#drawComplexControlMask">drawComplexControlMask</a>(). Each of these
|
---|
| 124 | functions is called with a range of parameters that provide
|
---|
| 125 | information that you can use to determine how to draw them, e.g.
|
---|
| 126 | style flags, rectangle, color group, etc.
|
---|
| 127 | <p> For information on changing elements of an existing style or
|
---|
| 128 | creating your own style see the <a href="customstyles.html">Style
|
---|
| 129 | overview</a>.
|
---|
| 130 | <p> Styles can also be created as <a href="plugins-howto.html">plugins</a>.
|
---|
| 131 | <p>See also <a href="appearance.html">Widget Appearance and Style</a>.
|
---|
| 132 |
|
---|
| 133 | <hr><h2>Member Type Documentation</h2>
|
---|
| 134 | <h3 class=fn><a name="ComplexControl-enum"></a>QStyle::ComplexControl</h3>
|
---|
| 135 |
|
---|
| 136 | <p> This enum represents a ComplexControl. ComplexControls have
|
---|
| 137 | different behaviour depending upon where the user clicks on them
|
---|
| 138 | or which keys are pressed.
|
---|
| 139 | <ul>
|
---|
| 140 | <li><tt>QStyle::CC_SpinWidget</tt>
|
---|
| 141 | <li><tt>QStyle::CC_ComboBox</tt>
|
---|
| 142 | <li><tt>QStyle::CC_ScrollBar</tt>
|
---|
| 143 | <li><tt>QStyle::CC_Slider</tt>
|
---|
| 144 | <li><tt>QStyle::CC_ToolButton</tt>
|
---|
| 145 | <li><tt>QStyle::CC_TitleBar</tt>
|
---|
| 146 | <li><tt>QStyle::CC_ListView</tt>
|
---|
| 147 | </ul><p> <ul>
|
---|
| 148 | <li><tt>QStyle::CC_CustomBase</tt> - base value for custom ControlElements. All
|
---|
| 149 | values above this are reserved for custom use. Therefore,
|
---|
| 150 | custom values must be greater than this value.
|
---|
| 151 | </ul><p> <p>See also <a href="#SubControl-enum">SubControl</a> and <a href="#drawComplexControl">drawComplexControl</a>().
|
---|
| 152 |
|
---|
| 153 | <h3 class=fn><a name="ContentsType-enum"></a>QStyle::ContentsType</h3>
|
---|
| 154 |
|
---|
| 155 | <p> This enum represents a ContentsType. It is used to calculate sizes
|
---|
| 156 | for the contents of various widgets.
|
---|
| 157 | <ul>
|
---|
| 158 | <li><tt>QStyle::CT_PushButton</tt>
|
---|
| 159 | <li><tt>QStyle::CT_CheckBox</tt>
|
---|
| 160 | <li><tt>QStyle::CT_RadioButton</tt>
|
---|
| 161 | <li><tt>QStyle::CT_ToolButton</tt>
|
---|
| 162 | <li><tt>QStyle::CT_ComboBox</tt>
|
---|
| 163 | <li><tt>QStyle::CT_Splitter</tt>
|
---|
| 164 | <li><tt>QStyle::CT_DockWindow</tt>
|
---|
| 165 | <li><tt>QStyle::CT_ProgressBar</tt>
|
---|
| 166 | <li><tt>QStyle::CT_PopupMenuItem</tt>
|
---|
| 167 | <li><tt>QStyle::CT_TabBarTab</tt>
|
---|
| 168 | <li><tt>QStyle::CT_Slider</tt>
|
---|
| 169 | <li><tt>QStyle::CT_Header</tt>
|
---|
| 170 | <li><tt>QStyle::CT_LineEdit</tt>
|
---|
| 171 | <li><tt>QStyle::CT_MenuBar</tt>
|
---|
| 172 | <li><tt>QStyle::CT_SpinBox</tt>
|
---|
| 173 | <li><tt>QStyle::CT_SizeGrip</tt>
|
---|
| 174 | <li><tt>QStyle::CT_TabWidget</tt>
|
---|
| 175 | <li><tt>QStyle::CT_DialogButtons</tt>
|
---|
| 176 | <li><tt>QStyle::CT_CustomBase</tt> - base value for custom ControlElements. All
|
---|
| 177 | values above this are reserved for custom use. Custom values
|
---|
| 178 | must be greater than this value.
|
---|
| 179 | </ul><p> <p>See also <a href="#sizeFromContents">sizeFromContents</a>().
|
---|
| 180 |
|
---|
| 181 | <h3 class=fn><a name="ControlElement-enum"></a>QStyle::ControlElement</h3>
|
---|
| 182 |
|
---|
| 183 | <p> This enum represents a ControlElement. A ControlElement is part of
|
---|
| 184 | a widget that performs some action or displays information to the
|
---|
| 185 | user.
|
---|
| 186 | <ul>
|
---|
| 187 | <li><tt>QStyle::CE_PushButton</tt> - the bevel and default indicator of a <a href="qpushbutton.html">QPushButton</a>.
|
---|
| 188 | <li><tt>QStyle::CE_PushButtonLabel</tt> - the label (iconset with text or pixmap)
|
---|
| 189 | of a QPushButton.
|
---|
| 190 | <li><tt>QStyle::CE_CheckBox</tt> - the indicator of a <a href="qcheckbox.html">QCheckBox</a>.
|
---|
| 191 | <li><tt>QStyle::CE_CheckBoxLabel</tt> - the label (text or pixmap) of a QCheckBox.
|
---|
| 192 | <li><tt>QStyle::CE_RadioButton</tt> - the indicator of a <a href="qradiobutton.html">QRadioButton</a>.
|
---|
| 193 | <li><tt>QStyle::CE_RadioButtonLabel</tt> - the label (text or pixmap) of a QRadioButton.
|
---|
| 194 | <li><tt>QStyle::CE_TabBarTab</tt> - the tab within a <a href="qtabbar.html">QTabBar</a> (a <a href="qtab.html">QTab</a>).
|
---|
| 195 | <li><tt>QStyle::CE_TabBarLabel</tt> - the label within a QTab.
|
---|
| 196 | <li><tt>QStyle::CE_ProgressBarGroove</tt> - the groove where the progress
|
---|
| 197 | indicator is drawn in a <a href="qprogressbar.html">QProgressBar</a>.
|
---|
| 198 | <li><tt>QStyle::CE_ProgressBarContents</tt> - the progress indicator of a QProgressBar.
|
---|
| 199 | <li><tt>QStyle::CE_ProgressBarLabel</tt> - the text label of a QProgressBar.
|
---|
| 200 | <li><tt>QStyle::CE_PopupMenuItem</tt> - a menu item in a <a href="qpopupmenu.html">QPopupMenu</a>.
|
---|
| 201 | <li><tt>QStyle::CE_PopupMenuScroller</tt> - scrolling areas in a popumenu when the
|
---|
| 202 | style supports scrolling.
|
---|
| 203 | <li><tt>QStyle::CE_PopupMenuHorizontalExtra</tt> - extra frame area set aside with PM_PopupMenuFrameHorizontalExtra
|
---|
| 204 | <li><tt>QStyle::CE_PopupMenuVerticalExtra</tt> - extra frame area set aside with PM_PopupMenuFrameVerticalExtra
|
---|
| 205 | <li><tt>QStyle::CE_MenuBarItem</tt> - a menu item in a <a href="qmenubar.html">QMenuBar</a>.
|
---|
| 206 | <li><tt>QStyle::CE_ToolButtonLabel</tt> - a tool button's label.
|
---|
| 207 | <li><tt>QStyle::CE_MenuBarEmptyArea</tt> - the empty area of a QMenuBar.
|
---|
| 208 | <li><tt>QStyle::CE_DockWindowEmptyArea</tt> - the empty area of a <a href="qdockwindow.html">QDockWindow</a>.
|
---|
| 209 | <li><tt>QStyle::CE_ToolBoxTab</tt> - the toolbox's tab area
|
---|
| 210 | <li><tt>QStyle::CE_HeaderLabel</tt> - the header's label
|
---|
| 211 | <li><tt>QStyle::CE_CustomBase</tt> - base value for custom ControlElements. All values above
|
---|
| 212 | this are reserved for custom use. Therefore, custom values must be
|
---|
| 213 | greater than this value.
|
---|
| 214 | </ul><p> <p>See also <a href="#drawControl">drawControl</a>().
|
---|
| 215 |
|
---|
| 216 | <h3 class=fn><a name="PixelMetric-enum"></a>QStyle::PixelMetric</h3>
|
---|
| 217 |
|
---|
| 218 | <p> This enum represents a PixelMetric. A PixelMetric is a style
|
---|
| 219 | dependent size represented as a single pixel value.
|
---|
| 220 | <ul>
|
---|
| 221 | <li><tt>QStyle::PM_ButtonMargin</tt> - amount of whitespace between pushbutton
|
---|
| 222 | labels and the frame.
|
---|
| 223 | <li><tt>QStyle::PM_ButtonDefaultIndicator</tt> - width of the default-button indicator frame.
|
---|
| 224 | <li><tt>QStyle::PM_MenuButtonIndicator</tt> - width of the menu button indicator
|
---|
| 225 | proportional to the widget height.
|
---|
| 226 | <li><tt>QStyle::PM_ButtonShiftHorizontal</tt> - horizontal contents shift of a
|
---|
| 227 | button when the button is down.
|
---|
| 228 | <li><tt>QStyle::PM_ButtonShiftVertical</tt> - vertical contents shift of a button when the
|
---|
| 229 | button is down.
|
---|
| 230 | <li><tt>QStyle::PM_DefaultFrameWidth</tt> - default frame width, usually 2.
|
---|
| 231 | <li><tt>QStyle::PM_SpinBoxFrameWidth</tt> - frame width of a spin box.
|
---|
| 232 | <li><tt>QStyle::PM_MDIFrameWidth</tt> - frame width of an MDI window.
|
---|
| 233 | <li><tt>QStyle::PM_MDIMinimizedWidth</tt> - width of a minimized MSI window.
|
---|
| 234 | <li><tt>QStyle::PM_MaximumDragDistance</tt> - Some feels require the scrollbar or
|
---|
| 235 | other sliders to jump back to the original position when the
|
---|
| 236 | mouse pointer is too far away while dragging. A value of -1
|
---|
| 237 | disables this behavior.
|
---|
| 238 | <li><tt>QStyle::PM_ScrollBarExtent</tt> - width of a vertical scrollbar and the
|
---|
| 239 | height of a horizontal scrollbar.
|
---|
| 240 | <li><tt>QStyle::PM_ScrollBarSliderMin</tt> - the minimum height of a vertical
|
---|
| 241 | scrollbar's slider and the minimum width of a horiztonal
|
---|
| 242 | scrollbar slider.
|
---|
| 243 | <li><tt>QStyle::PM_SliderThickness</tt> - total slider thickness.
|
---|
| 244 | <li><tt>QStyle::PM_SliderControlThickness</tt> - thickness of the slider handle.
|
---|
| 245 | <li><tt>QStyle::PM_SliderLength</tt> - length of the slider.
|
---|
| 246 | <li><tt>QStyle::PM_SliderTickmarkOffset</tt> - the offset between the tickmarks
|
---|
| 247 | and the slider.
|
---|
| 248 | <li><tt>QStyle::PM_SliderSpaceAvailable</tt> - the available space for the slider to move.
|
---|
| 249 | <li><tt>QStyle::PM_DockWindowSeparatorExtent</tt> - width of a separator in a
|
---|
| 250 | horiztonal dock window and the height of a separator in a
|
---|
| 251 | vertical dock window.
|
---|
| 252 | <li><tt>QStyle::PM_DockWindowHandleExtent</tt> - width of the handle in a
|
---|
| 253 | horizontal dock window and the height of the handle in a
|
---|
| 254 | vertical dock window.
|
---|
| 255 | <li><tt>QStyle::PM_DockWindowFrameWidth</tt> - frame width of a dock window.
|
---|
| 256 | <li><tt>QStyle::PM_MenuBarFrameWidth</tt> - frame width of a menubar.
|
---|
| 257 | <li><tt>QStyle::PM_MenuBarItemSpacing</tt> - spacing between menubar items.
|
---|
| 258 | <li><tt>QStyle::PM_ToolBarItemSpacing</tt> - spacing between toolbar items.
|
---|
| 259 | <li><tt>QStyle::PM_TabBarTabOverlap</tt> - number of pixels the tabs should overlap.
|
---|
| 260 | <li><tt>QStyle::PM_TabBarTabHSpace</tt> - extra space added to the tab width.
|
---|
| 261 | <li><tt>QStyle::PM_TabBarTabVSpace</tt> - extra space added to the tab height.
|
---|
| 262 | <li><tt>QStyle::PM_TabBarBaseHeight</tt> - height of the area between the tab bar
|
---|
| 263 | and the tab pages.
|
---|
| 264 | <li><tt>QStyle::PM_TabBarBaseOverlap</tt> - number of pixels the tab bar overlaps
|
---|
| 265 | the tab bar base.
|
---|
| 266 | <li><tt>QStyle::PM_TabBarScrollButtonWidth</tt>
|
---|
| 267 | <li><tt>QStyle::PM_TabBarTabShiftHorizontal</tt> - horizontal pixel shift when a
|
---|
| 268 | tab is selected.
|
---|
| 269 | <li><tt>QStyle::PM_TabBarTabShiftVertical</tt> - vertical pixel shift when a
|
---|
| 270 | tab is selected.
|
---|
| 271 | <li><tt>QStyle::PM_ProgressBarChunkWidth</tt> - width of a chunk in a progress bar indicator.
|
---|
| 272 | <li><tt>QStyle::PM_SplitterWidth</tt> - width of a splitter.
|
---|
| 273 | <li><tt>QStyle::PM_TitleBarHeight</tt> - height of the title bar.
|
---|
| 274 | <li><tt>QStyle::PM_PopupMenuFrameHorizontalExtra</tt> - additional border, e.g. for panels
|
---|
| 275 | <li><tt>QStyle::PM_PopupMenuFrameVerticalExtra</tt> - additional border, e.g. for panels
|
---|
| 276 | <li><tt>QStyle::PM_IndicatorWidth</tt> - width of a check box indicator.
|
---|
| 277 | <li><tt>QStyle::PM_IndicatorHeight</tt> - height of a checkbox indicator.
|
---|
| 278 | <li><tt>QStyle::PM_ExclusiveIndicatorWidth</tt> - width of a radio button indicator.
|
---|
| 279 | <li><tt>QStyle::PM_ExclusiveIndicatorHeight</tt> - height of a radio button indicator.
|
---|
| 280 | <li><tt>QStyle::PM_PopupMenuScrollerHeight</tt> - height of the scroller area in a popupmenu.
|
---|
| 281 | <li><tt>QStyle::PM_PopupMenuScrollerHeight</tt> - height of the scroller area in a popupmenu.
|
---|
| 282 | <li><tt>QStyle::PM_CheckListButtonSize</tt> - area (width/height) of the
|
---|
| 283 | checkbox/radiobutton in a <a href="qchecklistitem.html">QCheckListItem</a>
|
---|
| 284 | <li><tt>QStyle::PM_CheckListControllerSize</tt> - area (width/height) of the
|
---|
| 285 | controller in a QCheckListItem
|
---|
| 286 | <li><tt>QStyle::PM_DialogButtonsSeparator</tt> - distance between buttons in a dialog buttons widget.
|
---|
| 287 | <li><tt>QStyle::PM_DialogButtonsButtonWidth</tt> - minimum width of a button in a dialog buttons widget.
|
---|
| 288 | <li><tt>QStyle::PM_DialogButtonsButtonHeight</tt> - minimum height of a button in a dialog buttons widget.
|
---|
| 289 | <li><tt>QStyle::PM_HeaderMarkSize</tt>
|
---|
| 290 | <li><tt>QStyle::PM_HeaderGripMargin</tt>
|
---|
| 291 | <li><tt>QStyle::PM_HeaderMargin</tt>
|
---|
| 292 | <li><tt>QStyle::PM_CustomBase</tt> - base value for custom ControlElements. All
|
---|
| 293 | values above this are reserved for custom use. Therefore,
|
---|
| 294 | custom values must be greater than this value.
|
---|
| 295 | </ul><p> <p>See also <a href="#pixelMetric">pixelMetric</a>().
|
---|
| 296 |
|
---|
| 297 | <h3 class=fn><a name="PrimitiveElement-enum"></a>QStyle::PrimitiveElement</h3>
|
---|
| 298 |
|
---|
| 299 | <p> This enum represents the PrimitiveElements of a style. A
|
---|
| 300 | PrimitiveElement is a common GUI element, such as a checkbox
|
---|
| 301 | indicator or pushbutton bevel.
|
---|
| 302 | <ul>
|
---|
| 303 | <li><tt>QStyle::PE_ButtonCommand</tt> - button used to initiate an action, for
|
---|
| 304 | example, a <a href="qpushbutton.html">QPushButton</a>.
|
---|
| 305 | <li><tt>QStyle::PE_ButtonDefault</tt> - this button is the default button, e.g.
|
---|
| 306 | in a dialog.
|
---|
| 307 | <li><tt>QStyle::PE_ButtonBevel</tt> - generic button bevel.
|
---|
| 308 | <li><tt>QStyle::PE_ButtonTool</tt> - tool button, for example, a <a href="qtoolbutton.html">QToolButton</a>.
|
---|
| 309 | <li><tt>QStyle::PE_ButtonDropDown</tt> - drop down button, for example, a tool
|
---|
| 310 | button that displays a popup menu, for example, <a href="qpopupmenu.html">QPopupMenu</a>.
|
---|
| 311 | </ul><p> <ul>
|
---|
| 312 | <li><tt>QStyle::PE_FocusRect</tt> - generic focus indicator.
|
---|
| 313 | </ul><p> <ul>
|
---|
| 314 | <li><tt>QStyle::PE_ArrowUp</tt> - up arrow.
|
---|
| 315 | <li><tt>QStyle::PE_ArrowDown</tt> - down arrow.
|
---|
| 316 | <li><tt>QStyle::PE_ArrowRight</tt> - right arrow.
|
---|
| 317 | <li><tt>QStyle::PE_ArrowLeft</tt> - left arrow.
|
---|
| 318 | </ul><p> <ul>
|
---|
| 319 | <li><tt>QStyle::PE_SpinWidgetUp</tt> - up symbol for a spin widget, for example a
|
---|
| 320 | <a href="qspinbox.html">QSpinBox</a>.
|
---|
| 321 | <li><tt>QStyle::PE_SpinWidgetDown</tt> - down symbol for a spin widget.
|
---|
| 322 | <li><tt>QStyle::PE_SpinWidgetPlus</tt> - increase symbol for a spin widget.
|
---|
| 323 | <li><tt>QStyle::PE_SpinWidgetMinus</tt> - decrease symbol for a spin widget.
|
---|
| 324 | </ul><p> <ul>
|
---|
| 325 | <li><tt>QStyle::PE_Indicator</tt> - on/off indicator, for example, a <a href="qcheckbox.html">QCheckBox</a>.
|
---|
| 326 | <li><tt>QStyle::PE_IndicatorMask</tt> - bitmap mask for an indicator.
|
---|
| 327 | <li><tt>QStyle::PE_ExclusiveIndicator</tt> - exclusive on/off indicator, for
|
---|
| 328 | example, a <a href="qradiobutton.html">QRadioButton</a>.
|
---|
| 329 | <li><tt>QStyle::PE_ExclusiveIndicatorMask</tt> - bitmap mask for an exclusive indicator.
|
---|
| 330 | </ul><p> <ul>
|
---|
| 331 | <li><tt>QStyle::PE_DockWindowHandle</tt> - tear off handle for dock windows and
|
---|
| 332 | toolbars, for example <a href="qdockwindow.html">QDockWindow</a>s and <a href="qtoolbar.html">QToolBar</a>s.
|
---|
| 333 | <li><tt>QStyle::PE_DockWindowSeparator</tt> - item separator for dock window and
|
---|
| 334 | toolbar contents.
|
---|
| 335 | <li><tt>QStyle::PE_DockWindowResizeHandle</tt> - resize handle for dock windows.
|
---|
| 336 | <li><tt>QStyle::PE_Splitter</tt> - splitter handle; see also <a href="qsplitter.html">QSplitter</a>.
|
---|
| 337 | </ul><p> <ul>
|
---|
| 338 | <li><tt>QStyle::PE_Panel</tt> - generic panel frame; see also <a href="qframe.html">QFrame</a>.
|
---|
| 339 | <li><tt>QStyle::PE_PanelPopup</tt> - panel frame for popup windows/menus; see also
|
---|
| 340 | <a href="qpopupmenu.html">QPopupMenu</a>.
|
---|
| 341 | <li><tt>QStyle::PE_PanelMenuBar</tt> - panel frame for menu bars.
|
---|
| 342 | <li><tt>QStyle::PE_PanelDockWindow</tt> - panel frame for dock windows and toolbars.
|
---|
| 343 | <li><tt>QStyle::PE_PanelTabWidget</tt> - panel frame for tab widgets.
|
---|
| 344 | <li><tt>QStyle::PE_PanelLineEdit</tt> - panel frame for line edits.
|
---|
| 345 | <li><tt>QStyle::PE_PanelGroupBox</tt> - panel frame for group boxes.
|
---|
| 346 | <li><tt>QStyle::PE_TabBarBase</tt> - area below tabs in a tab widget, for example,
|
---|
| 347 | <a href="qtab.html">QTab</a>.
|
---|
| 348 | </ul><p> <ul>
|
---|
| 349 | <li><tt>QStyle::PE_HeaderSection</tt> - section of a list or table header; see also
|
---|
| 350 | <a href="qheader.html">QHeader</a>.
|
---|
| 351 | <li><tt>QStyle::PE_HeaderArrow</tt> - arrow used to indicate sorting on a list or table
|
---|
| 352 | header
|
---|
| 353 | <li><tt>QStyle::PE_StatusBarSection</tt> - section of a status bar; see also
|
---|
| 354 | <a href="qstatusbar.html">QStatusBar</a>.
|
---|
| 355 | </ul><p> <ul>
|
---|
| 356 | <li><tt>QStyle::PE_GroupBoxFrame</tt> - frame around a group box; see also
|
---|
| 357 | <a href="qgroupbox.html">QGroupBox</a>.
|
---|
| 358 | <li><tt>QStyle::PE_WindowFrame</tt> - frame around a MDI window or a docking window
|
---|
| 359 | </ul><p> <ul>
|
---|
| 360 | <li><tt>QStyle::PE_Separator</tt> - generic separator.
|
---|
| 361 | </ul><p> <ul>
|
---|
| 362 | <li><tt>QStyle::PE_SizeGrip</tt> - window resize handle; see also <a href="qsizegrip.html">QSizeGrip</a>.
|
---|
| 363 | </ul><p> <ul>
|
---|
| 364 | <li><tt>QStyle::PE_CheckMark</tt> - generic check mark; see also <a href="qcheckbox.html">QCheckBox</a>.
|
---|
| 365 | </ul><p> <ul>
|
---|
| 366 | <li><tt>QStyle::PE_ScrollBarAddLine</tt> - scrollbar line increase indicator
|
---|
| 367 | (i.e. scroll down); see also <a href="qscrollbar.html">QScrollBar</a>.
|
---|
| 368 | <li><tt>QStyle::PE_ScrollBarSubLine</tt> - scrollbar line decrease indicator (i.e. scroll up).
|
---|
| 369 | <li><tt>QStyle::PE_ScrollBarAddPage</tt> - scolllbar page increase indicator (i.e. page down).
|
---|
| 370 | <li><tt>QStyle::PE_ScrollBarSubPage</tt> - scrollbar page decrease indicator (i.e. page up).
|
---|
| 371 | <li><tt>QStyle::PE_ScrollBarSlider</tt> - scrollbar slider
|
---|
| 372 | <li><tt>QStyle::PE_ScrollBarFirst</tt> - scrollbar first line indicator (i.e. home).
|
---|
| 373 | <li><tt>QStyle::PE_ScrollBarLast</tt> - scrollbar last line indicator (i.e. end).
|
---|
| 374 | </ul><p> <ul>
|
---|
| 375 | <li><tt>QStyle::PE_ProgressBarChunk</tt> - section of a progress bar indicator; see
|
---|
| 376 | also <a href="qprogressbar.html">QProgressBar</a>.
|
---|
| 377 | <li><tt>QStyle::PE_CheckListController</tt> - controller part of a listview item
|
---|
| 378 | <li><tt>QStyle::PE_CheckListIndicator</tt> - checkbox part of a listview item
|
---|
| 379 | <li><tt>QStyle::PE_CheckListExclusiveIndicator</tt> - radiobutton part of a listview item
|
---|
| 380 | <li><tt>QStyle::PE_RubberBand</tt> - rubber band used in such things as iconview
|
---|
| 381 | <li><tt>QStyle::PE_CustomBase</tt> - base value for custom PrimitiveElements.
|
---|
| 382 | All values above this are reserved for custom use. Custom
|
---|
| 383 | values must be greater than this value.
|
---|
| 384 | </ul><p> <p>See also <a href="#drawPrimitive">drawPrimitive</a>().
|
---|
| 385 |
|
---|
| 386 | <h3 class=fn><a name="StyleFlags-enum"></a>QStyle::StyleFlags</h3>
|
---|
| 387 |
|
---|
| 388 | <p> This enum represents flags for drawing PrimitiveElements. Not all
|
---|
| 389 | primitives use all of these flags. Note that these flags may mean
|
---|
| 390 | different things to different primitives. For an explanation of
|
---|
| 391 | the relationship between primitives and their flags, as well as
|
---|
| 392 | the different meanings of the flags, see the <a href="customstyles.html">Style overview</a>.
|
---|
| 393 | <ul>
|
---|
| 394 | <li><tt>QStyle::Style_Default</tt>
|
---|
| 395 | <li><tt>QStyle::Style_Enabled</tt>
|
---|
| 396 | <li><tt>QStyle::Style_Raised</tt>
|
---|
| 397 | <li><tt>QStyle::Style_Sunken</tt>
|
---|
| 398 | <li><tt>QStyle::Style_Off</tt>
|
---|
| 399 | <li><tt>QStyle::Style_NoChange</tt>
|
---|
| 400 | <li><tt>QStyle::Style_On</tt>
|
---|
| 401 | <li><tt>QStyle::Style_Down</tt>
|
---|
| 402 | <li><tt>QStyle::Style_Horizontal</tt>
|
---|
| 403 | <li><tt>QStyle::Style_HasFocus</tt>
|
---|
| 404 | <li><tt>QStyle::Style_Top</tt>
|
---|
| 405 | <li><tt>QStyle::Style_Bottom</tt>
|
---|
| 406 | <li><tt>QStyle::Style_FocusAtBorder</tt>
|
---|
| 407 | <li><tt>QStyle::Style_AutoRaise</tt>
|
---|
| 408 | <li><tt>QStyle::Style_MouseOver</tt>
|
---|
| 409 | <li><tt>QStyle::Style_Up</tt>
|
---|
| 410 | <li><tt>QStyle::Style_Selected</tt>
|
---|
| 411 | <li><tt>QStyle::Style_HasFocus</tt>
|
---|
| 412 | <li><tt>QStyle::Style_Active</tt>
|
---|
| 413 | <li><tt>QStyle::Style_ButtonDefault</tt>
|
---|
| 414 | </ul><p> <p>See also <a href="#drawPrimitive">drawPrimitive</a>().
|
---|
| 415 |
|
---|
| 416 | <h3 class=fn><a name="StyleHint-enum"></a>QStyle::StyleHint</h3>
|
---|
| 417 |
|
---|
| 418 | <p> This enum represents a StyleHint. A StyleHint is a general look
|
---|
| 419 | and/or feel hint.
|
---|
| 420 | <ul>
|
---|
| 421 | <li><tt>QStyle::SH_EtchDisabledText</tt> - disabled text is "etched" like Windows.
|
---|
| 422 | <li><tt>QStyle::SH_GUIStyle</tt> - the GUI style to use.
|
---|
| 423 | <li><tt>QStyle::SH_ScrollBar_BackgroundMode</tt> - the background mode for a
|
---|
| 424 | <a href="qscrollbar.html">QScrollBar</a>. Possible values are any of those in the <a href="qt.html#BackgroundMode-enum">BackgroundMode</a> enum.
|
---|
| 425 | <li><tt>QStyle::SH_ScrollBar_MiddleClickAbsolutePosition</tt> - a boolean value.
|
---|
| 426 | If TRUE, middle clicking on a scrollbar causes the slider to
|
---|
| 427 | jump to that position. If FALSE, the middle clicking is
|
---|
| 428 | ignored.
|
---|
| 429 | <li><tt>QStyle::SH_ScrollBar_LeftClickAbsolutePosition</tt> - a boolean value.
|
---|
| 430 | If TRUE, left clicking on a scrollbar causes the slider to
|
---|
| 431 | jump to that position. If FALSE, the left clicking will
|
---|
| 432 | behave as appropriate for each control.
|
---|
| 433 | <li><tt>QStyle::SH_ScrollBar_ScrollWhenPointerLeavesControl</tt> - a boolean
|
---|
| 434 | value. If TRUE, when clicking a scrollbar SubControl, holding
|
---|
| 435 | the mouse button down and moving the pointer outside the
|
---|
| 436 | SubControl, the scrollbar continues to scroll. If FALSE, the
|
---|
| 437 | scollbar stops scrolling when the pointer leaves the
|
---|
| 438 | SubControl.
|
---|
| 439 | <li><tt>QStyle::SH_TabBar_Alignment</tt> - the alignment for tabs in a
|
---|
| 440 | <a href="qtabwidget.html">QTabWidget</a>. Possible values are <a href="qt.html#AlignmentFlags-enum">Qt::AlignLeft</a>, <a href="qt.html#AlignmentFlags-enum">Qt::AlignCenter</a> and <a href="qt.html#AlignmentFlags-enum">Qt::AlignRight</a>.
|
---|
| 441 | <li><tt>QStyle::SH_Header_ArrowAlignment</tt> - the placement of the sorting
|
---|
| 442 | indicator may appear in list or table headers. Possible values
|
---|
| 443 | are <a href="qt.html#Dock-enum">Qt::Left</a> or <a href="qt.html#Dock-enum">Qt::Right</a>.
|
---|
| 444 | <li><tt>QStyle::SH_Slider_SnapToValue</tt> - sliders snap to values while moving,
|
---|
| 445 | like Windows
|
---|
| 446 | <li><tt>QStyle::SH_Slider_SloppyKeyEvents</tt> - key presses handled in a sloppy
|
---|
| 447 | manner, i.e. left on a vertical slider subtracts a line.
|
---|
| 448 | <li><tt>QStyle::SH_ProgressDialog_CenterCancelButton</tt> - center button on
|
---|
| 449 | progress dialogs, like <a href="motif-extension.html#Motif">Motif</a>, otherwise right aligned.
|
---|
| 450 | <li><tt>QStyle::SH_ProgressDialog_TextLabelAlignment</tt> - Qt::AlignmentFlags --
|
---|
| 451 | text label alignment in progress dialogs; Center on windows,
|
---|
| 452 | Auto|VCenter otherwise.
|
---|
| 453 | <li><tt>QStyle::SH_PrintDialog_RightAlignButtons</tt> - right align buttons in
|
---|
| 454 | the print dialog, like Windows.
|
---|
| 455 | <li><tt>QStyle::SH_MainWindow_SpaceBelowMenuBar</tt> - 1 or 2 pixel space between
|
---|
| 456 | the menubar and the dockarea, like Windows.
|
---|
| 457 | <li><tt>QStyle::SH_FontDialog_SelectAssociatedText</tt> - select the text in the
|
---|
| 458 | line edit, or when selecting an item from the listbox, or when
|
---|
| 459 | the line edit receives focus, like Windows.
|
---|
| 460 | <li><tt>QStyle::SH_PopupMenu_AllowActiveAndDisabled</tt> - allows disabled menu
|
---|
| 461 | items to be active.
|
---|
| 462 | <li><tt>QStyle::SH_PopupMenu_SpaceActivatesItem</tt> - pressing Space activates
|
---|
| 463 | the item, like Motif.
|
---|
| 464 | <li><tt>QStyle::SH_PopupMenu_SubMenuPopupDelay</tt> - the number of milliseconds
|
---|
| 465 | to wait before opening a submenu; 256 on windows, 96 on Motif.
|
---|
| 466 | <li><tt>QStyle::SH_PopupMenu_Scrollable</tt> - whether popupmenu's must support
|
---|
| 467 | scrolling.
|
---|
| 468 | <li><tt>QStyle::SH_PopupMenu_SloppySubMenus</tt> - whether popupmenu's must support
|
---|
| 469 | sloppy submenu; as implemented on Mac OS.
|
---|
| 470 | <li><tt>QStyle::SH_ScrollView_FrameOnlyAroundContents</tt> - whether scrollviews
|
---|
| 471 | draw their frame only around contents (like Motif), or around
|
---|
| 472 | contents, scrollbars and corner widgets (like Windows).
|
---|
| 473 | <li><tt>QStyle::SH_MenuBar_AltKeyNavigation</tt> - menubars items are navigable
|
---|
| 474 | by pressing Alt, followed by using the arrow keys to select
|
---|
| 475 | the desired item.
|
---|
| 476 | <li><tt>QStyle::SH_ComboBox_ListMouseTracking</tt> - mouse tracking in combobox
|
---|
| 477 | dropdown lists.
|
---|
| 478 | <li><tt>QStyle::SH_PopupMenu_MouseTracking</tt> - mouse tracking in popup menus.
|
---|
| 479 | <li><tt>QStyle::SH_MenuBar_MouseTracking</tt> - mouse tracking in menubars.
|
---|
| 480 | <li><tt>QStyle::SH_ItemView_ChangeHighlightOnFocus</tt> - gray out selected items
|
---|
| 481 | when losing focus.
|
---|
| 482 | <li><tt>QStyle::SH_Widget_ShareActivation</tt> - turn on sharing activation with
|
---|
| 483 | floating modeless dialogs.
|
---|
| 484 | <li><tt>QStyle::SH_TabBar_SelectMouseType</tt> - which type of mouse event should
|
---|
| 485 | cause a tab to be selected.
|
---|
| 486 | <li><tt>QStyle::SH_ListViewExpand_SelectMouseType</tt> - which type of mouse event should
|
---|
| 487 | cause a listview expansion to be selected.
|
---|
| 488 | <li><tt>QStyle::SH_TabBar_PreferNoArrows</tt> - whether a tabbar should suggest a size
|
---|
| 489 | to prevent scoll arrows.
|
---|
| 490 | <li><tt>QStyle::SH_ComboBox_Popup</tt> - allows popups as a combobox dropdown
|
---|
| 491 | menu.
|
---|
| 492 | <li><tt>QStyle::SH_Workspace_FillSpaceOnMaximize</tt> - the workspace should
|
---|
| 493 | maximize the client area.
|
---|
| 494 | <li><tt>QStyle::SH_TitleBar_NoBorder</tt> - the titlebar has no border
|
---|
| 495 | <li><tt>QStyle::SH_ScrollBar_StopMouseOverSlider</tt> - stops autorepeat when
|
---|
| 496 | slider reaches mouse
|
---|
| 497 | <li><tt>QStyle::SH_BlinkCursorWhenTextSelected</tt> - whether cursor should blink
|
---|
| 498 | when text is selected
|
---|
| 499 | <li><tt>QStyle::SH_RichText_FullWidthSelection</tt> - whether richtext selections
|
---|
| 500 | should extend the full width of the document.
|
---|
| 501 | <li><tt>QStyle::SH_GroupBox_TextLabelVerticalAlignment</tt> - how to vertically align a
|
---|
| 502 | groupbox's text label.
|
---|
| 503 | <li><tt>QStyle::SH_GroupBox_TextLabelColor</tt> - how to paint a groupbox's text label.
|
---|
| 504 | <li><tt>QStyle::SH_DialogButtons_DefaultButton</tt> - which buttons gets the
|
---|
| 505 | default status in a dialog's button widget.
|
---|
| 506 | <li><tt>QStyle::SH_CustomBase</tt> - base value for custom ControlElements. All
|
---|
| 507 | values above this are reserved for custom use. Therefore,
|
---|
| 508 | custom values must be greater than this value.
|
---|
| 509 | <li><tt>QStyle::SH_ToolButton_Uses3D</tt> - indicates whether QToolButtons should
|
---|
| 510 | use a 3D frame when the mouse is over them
|
---|
| 511 | <li><tt>QStyle::SH_ToolBox_SelectedPageTitleBold</tt> - Boldness of the selected
|
---|
| 512 | page title in a <a href="qtoolbox.html">QToolBox</a>.
|
---|
| 513 | <li><tt>QStyle::SH_LineEdit_PasswordCharacter</tt> - The <a href="qchar.html">QChar</a> Unicode character
|
---|
| 514 | to be used for passwords.
|
---|
| 515 | <li><tt>QStyle::SH_Table_GridLineColor</tt>
|
---|
| 516 | <li><tt>QStyle::SH_UnderlineAccelerator</tt> - whether accelerators are underlined
|
---|
| 517 | </ul><p> <p>See also <a href="#styleHint">styleHint</a>().
|
---|
| 518 |
|
---|
| 519 | <h3 class=fn><a name="StylePixmap-enum"></a>QStyle::StylePixmap</h3>
|
---|
| 520 |
|
---|
| 521 | <p> This enum represents a StylePixmap. A StylePixmap is a pixmap that
|
---|
| 522 | can follow some existing GUI style or guideline.
|
---|
| 523 | <p> <ul>
|
---|
| 524 | <li><tt>QStyle::SP_TitleBarMinButton</tt> - minimize button on titlebars. For
|
---|
| 525 | example, in a <a href="qworkspace.html">QWorkspace</a>.
|
---|
| 526 | <li><tt>QStyle::SP_TitleBarMaxButton</tt> - maximize button on titlebars.
|
---|
| 527 | <li><tt>QStyle::SP_TitleBarCloseButton</tt> - close button on titlebars.
|
---|
| 528 | <li><tt>QStyle::SP_TitleBarNormalButton</tt> - normal (restore) button on titlebars.
|
---|
| 529 | <li><tt>QStyle::SP_TitleBarShadeButton</tt> - shade button on titlebars.
|
---|
| 530 | <li><tt>QStyle::SP_TitleBarUnshadeButton</tt> - unshade button on titlebars.
|
---|
| 531 | <li><tt>QStyle::SP_MessageBoxInformation</tt> - the 'information' icon.
|
---|
| 532 | <li><tt>QStyle::SP_MessageBoxWarning</tt> - the 'warning' icon.
|
---|
| 533 | <li><tt>QStyle::SP_MessageBoxCritical</tt> - the 'critical' icon.
|
---|
| 534 | <li><tt>QStyle::SP_MessageBoxQuestion</tt> - the 'question' icon.
|
---|
| 535 | </ul><p> <ul>
|
---|
| 536 | <li><tt>QStyle::SP_DockWindowCloseButton</tt> - close button on dock windows;
|
---|
| 537 | see also <a href="qdockwindow.html">QDockWindow</a>.
|
---|
| 538 | </ul><p> <ul>
|
---|
| 539 | <li><tt>QStyle::SP_CustomBase</tt> - base value for custom ControlElements. All
|
---|
| 540 | values above this are reserved for custom use. Therefore,
|
---|
| 541 | custom values must be greater than this value.
|
---|
| 542 | </ul><p> <p>See also <a href="#stylePixmap">stylePixmap</a>().
|
---|
| 543 |
|
---|
| 544 | <h3 class=fn><a name="SubControl-enum"></a>QStyle::SubControl</h3>
|
---|
| 545 |
|
---|
| 546 | <p> This enum represents a SubControl within a ComplexControl.
|
---|
| 547 | <ul>
|
---|
| 548 | <li><tt>QStyle::SC_None</tt> - special value that matches no other SubControl.
|
---|
| 549 | </ul><p> <ul>
|
---|
| 550 | <li><tt>QStyle::SC_ScrollBarAddLine</tt> - scrollbar add line (i.e. down/right
|
---|
| 551 | arrow); see also QScrollbar.
|
---|
| 552 | <li><tt>QStyle::SC_ScrollBarSubLine</tt> - scrollbar sub line (i.e. up/left arrow).
|
---|
| 553 | <li><tt>QStyle::SC_ScrollBarAddPage</tt> - scrollbar add page (i.e. page down).
|
---|
| 554 | <li><tt>QStyle::SC_ScrollBarSubPage</tt> - scrollbar sub page (i.e. page up).
|
---|
| 555 | <li><tt>QStyle::SC_ScrollBarFirst</tt> - scrollbar first line (i.e. home).
|
---|
| 556 | <li><tt>QStyle::SC_ScrollBarLast</tt> - scrollbar last line (i.e. end).
|
---|
| 557 | <li><tt>QStyle::SC_ScrollBarSlider</tt> - scrollbar slider handle.
|
---|
| 558 | <li><tt>QStyle::SC_ScrollBarGroove</tt> - special subcontrol which contains the
|
---|
| 559 | area in which the slider handle may move.
|
---|
| 560 | </ul><p> <ul>
|
---|
| 561 | <li><tt>QStyle::SC_SpinWidgetUp</tt> - spinwidget up/increase; see also <a href="qspinbox.html">QSpinBox</a>.
|
---|
| 562 | <li><tt>QStyle::SC_SpinWidgetDown</tt> - spinwidget down/decrease.
|
---|
| 563 | <li><tt>QStyle::SC_SpinWidgetFrame</tt> - spinwidget frame.
|
---|
| 564 | <li><tt>QStyle::SC_SpinWidgetEditField</tt> - spinwidget edit field.
|
---|
| 565 | <li><tt>QStyle::SC_SpinWidgetButtonField</tt> - spinwidget button field.
|
---|
| 566 | </ul><p> <ul>
|
---|
| 567 | <li><tt>QStyle::SC_ComboBoxEditField</tt> - combobox edit field; see also <a href="qcombobox.html">QComboBox</a>.
|
---|
| 568 | <li><tt>QStyle::SC_ComboBoxArrow</tt> - combobox arrow
|
---|
| 569 | <li><tt>QStyle::SC_ComboBoxFrame</tt> - combobox frame
|
---|
| 570 | <li><tt>QStyle::SC_ComboBoxListBoxPopup</tt> - combobox list box
|
---|
| 571 | <li><tt>QStyle::SC_SliderGroove</tt> - special subcontrol which contains the area
|
---|
| 572 | in which the slider handle may move.
|
---|
| 573 | <li><tt>QStyle::SC_SliderHandle</tt> - slider handle.
|
---|
| 574 | <li><tt>QStyle::SC_SliderTickmarks</tt> - slider tickmarks.
|
---|
| 575 | </ul><p> <ul>
|
---|
| 576 | <li><tt>QStyle::SC_ToolButton</tt> - tool button; see also QToolbutton.
|
---|
| 577 | <li><tt>QStyle::SC_ToolButtonMenu</tt> - subcontrol for opening a popup menu in a
|
---|
| 578 | tool button; see also <a href="qpopupmenu.html">QPopupMenu</a>.
|
---|
| 579 | </ul><p> <ul>
|
---|
| 580 | <li><tt>QStyle::SC_TitleBarSysMenu</tt> - system menu button (i.e. restore, close, etc.).
|
---|
| 581 | <li><tt>QStyle::SC_TitleBarMinButton</tt> - minimize button.
|
---|
| 582 | <li><tt>QStyle::SC_TitleBarMaxButton</tt> - maximize button.
|
---|
| 583 | <li><tt>QStyle::SC_TitleBarCloseButton</tt> - close button.
|
---|
| 584 | <li><tt>QStyle::SC_TitleBarLabel</tt> - window title label.
|
---|
| 585 | <li><tt>QStyle::SC_TitleBarNormalButton</tt> - normal (restore) button.
|
---|
| 586 | <li><tt>QStyle::SC_TitleBarShadeButton</tt> - shade button.
|
---|
| 587 | <li><tt>QStyle::SC_TitleBarUnshadeButton</tt> - unshade button.
|
---|
| 588 | </ul><p> <ul>
|
---|
| 589 | <li><tt>QStyle::SC_ListView</tt> - the list view area.
|
---|
| 590 | <li><tt>QStyle::SC_ListViewBranch</tt> - (internal)
|
---|
| 591 | <li><tt>QStyle::SC_ListViewExpand</tt> - expand item (i.e. show/hide child items).
|
---|
| 592 | </ul><p> <ul>
|
---|
| 593 | <li><tt>QStyle::SC_All</tt> - special value that matches all SubControls.
|
---|
| 594 | </ul><p> <p>See also <a href="#ComplexControl-enum">ComplexControl</a>.
|
---|
| 595 |
|
---|
| 596 | <h3 class=fn><a name="SubRect-enum"></a>QStyle::SubRect</h3>
|
---|
| 597 |
|
---|
| 598 | <p> This enum represents a sub-area of a widget. Style implementations
|
---|
| 599 | would use these areas to draw the different parts of a widget.
|
---|
| 600 | <ul>
|
---|
| 601 | <li><tt>QStyle::SR_PushButtonContents</tt> - area containing the label (iconset
|
---|
| 602 | with text or pixmap).
|
---|
| 603 | <li><tt>QStyle::SR_PushButtonFocusRect</tt> - area for the focus rect (usually
|
---|
| 604 | larger than the contents rect).
|
---|
| 605 | <li><tt>QStyle::SR_CheckBoxIndicator</tt> - area for the state indicator (e.g. check mark).
|
---|
| 606 | <li><tt>QStyle::SR_CheckBoxContents</tt> - area for the label (text or pixmap).
|
---|
| 607 | <li><tt>QStyle::SR_CheckBoxFocusRect</tt> - area for the focus indicator.
|
---|
| 608 | </ul><p> <ul>
|
---|
| 609 | <li><tt>QStyle::SR_RadioButtonIndicator</tt> - area for the state indicator.
|
---|
| 610 | <li><tt>QStyle::SR_RadioButtonContents</tt> - area for the label.
|
---|
| 611 | <li><tt>QStyle::SR_RadioButtonFocusRect</tt> - area for the focus indicator.
|
---|
| 612 | </ul><p> <ul>
|
---|
| 613 | <li><tt>QStyle::SR_ComboBoxFocusRect</tt> - area for the focus indicator.
|
---|
| 614 | </ul><p> <ul>
|
---|
| 615 | <li><tt>QStyle::SR_SliderFocusRect</tt> - area for the focus indicator.
|
---|
| 616 | </ul><p> <ul>
|
---|
| 617 | <li><tt>QStyle::SR_DockWindowHandleRect</tt> - area for the tear-off handle.
|
---|
| 618 | </ul><p> <ul>
|
---|
| 619 | <li><tt>QStyle::SR_ProgressBarGroove</tt> - area for the groove.
|
---|
| 620 | <li><tt>QStyle::SR_ProgressBarContents</tt> - area for the progress indicator.
|
---|
| 621 | <li><tt>QStyle::SR_ProgressBarLabel</tt> - area for the text label.
|
---|
| 622 | </ul><p> <ul>
|
---|
| 623 | <li><tt>QStyle::SR_ToolButtonContents</tt> - area for the tool button's label.
|
---|
| 624 | <li><tt>QStyle::SR_DialogButtonAccept</tt> - area for a dialog's accept button.
|
---|
| 625 | <li><tt>QStyle::SR_DialogButtonReject</tt> - area for a dialog's reject button.
|
---|
| 626 | <li><tt>QStyle::SR_DialogButtonApply</tt> - area for a dialog's apply button.
|
---|
| 627 | <li><tt>QStyle::SR_DialogButtonHelp</tt> - area for a dialog's help button.
|
---|
| 628 | <li><tt>QStyle::SR_DialogButtonAll</tt> - area for a dialog's all button.
|
---|
| 629 | <li><tt>QStyle::SR_DialogButtonRetry</tt> - area for a dialog's retry button.
|
---|
| 630 | <li><tt>QStyle::SR_DialogButtonAbort</tt> - area for a dialog's abort button.
|
---|
| 631 | <li><tt>QStyle::SR_DialogButtonIgnore</tt> - area for a dialog's ignore button.
|
---|
| 632 | <li><tt>QStyle::SR_DialogButtonCustom</tt> - area for a dialog's custom widget area (in button row).
|
---|
| 633 | <li><tt>QStyle::SR_ToolBoxTabContents</tt> - area for a toolbox tab's icon and label
|
---|
| 634 | <li><tt>QStyle::SR_CustomBase</tt> - base value for custom ControlElements. All values above
|
---|
| 635 | this are reserved for custom use. Therefore, custom values must be
|
---|
| 636 | greater than this value.
|
---|
| 637 | </ul><p> <p>See also <a href="#subRect">subRect</a>().
|
---|
| 638 |
|
---|
| 639 | <hr><h2>Member Function Documentation</h2>
|
---|
| 640 | <h3 class=fn><a name="QStyle"></a>QStyle::QStyle ()
|
---|
| 641 | </h3>
|
---|
| 642 | Constructs a QStyle.
|
---|
| 643 |
|
---|
| 644 | <h3 class=fn><a name="~QStyle"></a>QStyle::~QStyle ()<tt> [virtual]</tt>
|
---|
| 645 | </h3>
|
---|
| 646 | Destroys the style and frees all allocated resources.
|
---|
| 647 |
|
---|
| 648 | <h3 class=fn>int <a name="defaultFrameWidth"></a>QStyle::defaultFrameWidth () const
|
---|
| 649 | </h3>
|
---|
| 650 |
|
---|
| 651 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 652 | <p>
|
---|
| 653 | <h3 class=fn>void <a name="drawComplexControl"></a>QStyle::drawComplexControl ( <a href="qstyle.html#ComplexControl-enum">ComplexControl</a> control, <a href="qpainter.html">QPainter</a> * p, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & r, const <a href="qcolorgroup.html">QColorGroup</a> & cg, SFlags how = Style_Default, SCFlags sub = SC_All, SCFlags subActive = SC_None, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 654 | </h3>
|
---|
| 655 |
|
---|
| 656 | <p> Draws the ComplexControl <em>control</em> using the painter <em>p</em> in the
|
---|
| 657 | area <em>r</em>. Colors are used from the color group <em>cg</em>. The <em>sub</em>
|
---|
| 658 | argument specifies which SubControls to draw. Multiple SubControls
|
---|
| 659 | can be OR'ed together. The <em>subActive</em> argument specifies which
|
---|
| 660 | SubControl is active.
|
---|
| 661 | <p> The rect <em>r</em> should be in logical coordinates. Reimplementations
|
---|
| 662 | of this function should use <a href="#visualRect">visualRect</a>() to change the logical
|
---|
| 663 | coordinates into screen coordinates when using <a href="#drawPrimitive">drawPrimitive</a>() and
|
---|
| 664 | <a href="#drawControl">drawControl</a>().
|
---|
| 665 | <p> The <em>how</em> argument is used to control how the ComplexControl is
|
---|
| 666 | drawn. Multiple flags can OR'ed together. See the table below for
|
---|
| 667 | an explanation of which flags are used with the various
|
---|
| 668 | ComplexControls.
|
---|
| 669 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 670 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 671 | on the value of <em>control</em>. The <em>opt</em> argument can be used to
|
---|
| 672 | pass extra information required when drawing the ComplexControl.
|
---|
| 673 | Note that <em>opt</em> may be the default value even for ComplexControls
|
---|
| 674 | that can make use of the extra options. See the table below for
|
---|
| 675 | the appropriate <em>widget</em> and <em>opt</em> usage:
|
---|
| 676 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 677 | <tr bgcolor="#a2c511"> <th valign="top">ComplexControl<br>& Widget Cast
|
---|
| 678 | <th valign="top">Style Flags
|
---|
| 679 | <th valign="top">Notes
|
---|
| 680 | <th valign="top">Options
|
---|
| 681 | <th valign="top">Notes
|
---|
| 682 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ComplexControl-enum">CC_SpinWidget</a>(const QSpinWidget *)
|
---|
| 683 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the spinwidget is enabled.
|
---|
| 684 | <td valign="top" colspan="1" rowspan="2"> Unused.
|
---|
| 685 | <td valign="top" colspan="1" rowspan="2">
|
---|
| 686 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the spinwidget has input focus.
|
---|
| 687 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ComplexControl-enum">CC_ComboBox</a>(const <a href="qcombobox.html">QComboBox</a> *)
|
---|
| 688 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the combobox is enabled.
|
---|
| 689 | <td valign="top" colspan="1" rowspan="2"> Unused.
|
---|
| 690 | <td valign="top" colspan="1" rowspan="2">
|
---|
| 691 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the combobox has input focus.
|
---|
| 692 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ComplexControl-enum">CC_ScrollBar</a>(const <a href="qscrollbar.html">QScrollBar</a> *)
|
---|
| 693 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the scrollbar is enabled.
|
---|
| 694 | <td valign="top" colspan="1" rowspan="2"> Unused.
|
---|
| 695 | <td valign="top" colspan="1" rowspan="2">
|
---|
| 696 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the scrollbar has input focus.
|
---|
| 697 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ComplexControl-enum">CC_Slider</a>(const <a href="qslider.html">QSlider</a> *)
|
---|
| 698 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the slider is enabled.
|
---|
| 699 | <td valign="top" colspan="1" rowspan="2"> Unused.
|
---|
| 700 | <td valign="top" colspan="1" rowspan="2">
|
---|
| 701 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the slider has input focus.
|
---|
| 702 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="6"> <a href="#ComplexControl-enum">CC_ToolButton</a>(const <a href="qtoolbutton.html">QToolButton</a> *)
|
---|
| 703 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the toolbutton is enabled.
|
---|
| 704 | <td valign="top" colspan="1" rowspan="6"> <a href="qstyleoption.html">QStyleOption</a> ( <a href="qt.html#ArrowType-enum">ArrowType</a> t )
|
---|
| 705 | <ul>
|
---|
| 706 | <li> opt.<a href="qstyleoption.html#arrowType">arrowType</a>()
|
---|
| 707 | </ul>
|
---|
| 708 | <td valign="top" colspan="1" rowspan="6"> When the tool button only contains an arrow, <em>t</em> is the
|
---|
| 709 | arrow's type.
|
---|
| 710 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the toolbutton has input focus.
|
---|
| 711 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the toolbutton is down (ie. mouse
|
---|
| 712 | button or space pressed).
|
---|
| 713 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_On</a> <td valign="top">Set if the toolbutton is a toggle button
|
---|
| 714 | and is toggled on.
|
---|
| 715 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_AutoRaise</a> <td valign="top">Set if the toolbutton has auto-raise enabled.
|
---|
| 716 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Raised</a> <td valign="top">Set if the button is not down, not on and doesn't
|
---|
| 717 | contain the mouse when auto-raise is enabled.
|
---|
| 718 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ComplexControl-enum">CC_TitleBar</a>(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 719 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the titlebar is enabled.
|
---|
| 720 | <td valign="top">Unused.
|
---|
| 721 | <td valign="top">
|
---|
| 722 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ComplexControl-enum">CC_ListView</a>(const <a href="qlistview.html">QListView</a> *)
|
---|
| 723 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the titlebar is enabled.
|
---|
| 724 | <td valign="top"><a href="qstyleoption.html">QStyleOption</a> ( <a href="qlistviewitem.html">QListViewItem</a> *item )
|
---|
| 725 | <ul>
|
---|
| 726 | <li> opt.<a href="qstyleoption.html#listViewItem">listViewItem</a>()
|
---|
| 727 | </ul>
|
---|
| 728 | <td valign="top"><em>item</em> is the item that needs branches drawn
|
---|
| 729 | </table></center>
|
---|
| 730 | <p> <p>See also <a href="#ComplexControl-enum">ComplexControl</a> and <a href="#SubControl-enum">SubControl</a>.
|
---|
| 731 |
|
---|
| 732 | <h3 class=fn>void <a name="drawComplexControlMask"></a>QStyle::drawComplexControlMask ( <a href="qstyle.html#ComplexControl-enum">ComplexControl</a> control, <a href="qpainter.html">QPainter</a> * p, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & r, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 733 | </h3>
|
---|
| 734 |
|
---|
| 735 | <p> Draw a bitmask for the ComplexControl <em>control</em> using the painter
|
---|
| 736 | <em>p</em> in the area <em>r</em>. See <a href="#drawComplexControl">drawComplexControl</a>() for an explanation
|
---|
| 737 | of the use of the <em>widget</em> and <em>opt</em> arguments.
|
---|
| 738 | <p> The rect <em>r</em> should be in logical coordinates. Reimplementations
|
---|
| 739 | of this function should use <a href="#visualRect">visualRect</a>() to change the logical
|
---|
| 740 | corrdinates into screen coordinates when using <a href="#drawPrimitive">drawPrimitive</a>() and
|
---|
| 741 | <a href="#drawControl">drawControl</a>().
|
---|
| 742 | <p> <p>See also <a href="#drawComplexControl">drawComplexControl</a>() and <a href="#ComplexControl-enum">ComplexControl</a>.
|
---|
| 743 |
|
---|
| 744 | <h3 class=fn>void <a name="drawControl"></a>QStyle::drawControl ( <a href="qstyle.html#ControlElement-enum">ControlElement</a> element, <a href="qpainter.html">QPainter</a> * p, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & r, const <a href="qcolorgroup.html">QColorGroup</a> & cg, SFlags how = Style_Default, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 745 | </h3>
|
---|
| 746 |
|
---|
| 747 | <p> Draws the ControlElement <em>element</em> using the painter <em>p</em> in the
|
---|
| 748 | area <em>r</em>. Colors are used from the color group <em>cg</em>.
|
---|
| 749 | <p> The rect <em>r</em> should be in screen coordinates.
|
---|
| 750 | <p> The <em>how</em> argument is used to control how the ControlElement is
|
---|
| 751 | drawn. Multiple flags can be OR'ed together. See the table below
|
---|
| 752 | for an explanation of which flags are used with the various
|
---|
| 753 | ControlElements.
|
---|
| 754 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 755 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 756 | on the value of <em>element</em>. The <em>opt</em> argument can be used to
|
---|
| 757 | pass extra information required when drawing the ControlElement.
|
---|
| 758 | Note that <em>opt</em> may be the default value even for ControlElements
|
---|
| 759 | that can make use of the extra options. See the table below for
|
---|
| 760 | the appropriate <em>widget</em> and <em>opt</em> usage:
|
---|
| 761 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 762 | <tr bgcolor="#a2c511"> <th valign="top">ControlElement<br>& Widget Cast
|
---|
| 763 | <th valign="top">Style Flags
|
---|
| 764 | <th valign="top">Notes
|
---|
| 765 | <th valign="top">Options
|
---|
| 766 | <th valign="top">Notes
|
---|
| 767 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="6"> <a href="#ControlElement-enum">CE_PushButton</a>(const <a href="qpushbutton.html">QPushButton</a> *)
|
---|
| 768 | <p> and
|
---|
| 769 | <p> <a href="#ControlElement-enum">CE_PushButtonLabel</a>(const <a href="qpushbutton.html">QPushButton</a> *)
|
---|
| 770 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the button is enabled.
|
---|
| 771 | <td valign="top" colspan="1" rowspan="6"> Unused.
|
---|
| 772 | <td valign="top" colspan="1" rowspan="6">
|
---|
| 773 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the button has input focus.
|
---|
| 774 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Raised</a> <td valign="top">Set if the button is not down, not on and not flat.
|
---|
| 775 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_On</a> <td valign="top">Set if the button is a toggle button and toggled on.
|
---|
| 776 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the button is down (i.e., the mouse button or
|
---|
| 777 | space bar is pressed on the button).
|
---|
| 778 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_ButtonDefault</a> <td valign="top">Set if the button is a default button.
|
---|
| 779 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="6"> <a href="#ControlElement-enum">CE_CheckBox</a>(const <a href="qcheckbox.html">QCheckBox</a> *)
|
---|
| 780 | <p> and
|
---|
| 781 | <p> <a href="#ControlElement-enum">CE_CheckBoxLabel</a>(const <a href="qcheckbox.html">QCheckBox</a> *)
|
---|
| 782 | <p> <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the checkbox is enabled.
|
---|
| 783 | <td valign="top" colspan="1" rowspan="6"> Unused.
|
---|
| 784 | <td valign="top" colspan="1" rowspan="6">
|
---|
| 785 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the checkbox has input focus.
|
---|
| 786 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_On</a> <td valign="top">Set if the checkbox is checked.
|
---|
| 787 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Off</a> <td valign="top">Set if the checkbox is not checked.
|
---|
| 788 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_NoChange</a> <td valign="top">Set if the checkbox is in the NoChange state.
|
---|
| 789 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the checkbox is down (i.e., the mouse button or
|
---|
| 790 | space bar is pressed on the button).
|
---|
| 791 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="5"> <a href="#ControlElement-enum">CE_RadioButton</a>(const <a href="qradiobutton.html">QRadioButton</a> *)
|
---|
| 792 | <p> and
|
---|
| 793 | <p> <a href="#ControlElement-enum">CE_RadioButtonLabel</a>(const QRadioButton *)
|
---|
| 794 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the radiobutton is enabled.
|
---|
| 795 | <td valign="top" colspan="1" rowspan="5"> Unused.
|
---|
| 796 | <td valign="top" colspan="1" rowspan="5">
|
---|
| 797 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the radiobutton has input focus.
|
---|
| 798 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_On</a> <td valign="top">Set if the radiobutton is checked.
|
---|
| 799 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Off</a> <td valign="top">Set if the radiobutton is not checked.
|
---|
| 800 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the radiobutton is down (i.e., the mouse
|
---|
| 801 | button or space bar is pressed on the radiobutton).
|
---|
| 802 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ControlElement-enum">CE_TabBarTab</a>(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 803 | <p> and
|
---|
| 804 | <p> <a href="#ControlElement-enum">CE_TabBarLabel</a>(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 805 | <p> <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the tabbar and tab is enabled.
|
---|
| 806 | <td valign="top" colspan="1" rowspan="2"> <a href="qstyleoption.html">QStyleOption</a> ( <a href="qtab.html">QTab</a> *t )
|
---|
| 807 | <ul>
|
---|
| 808 | <li> opt.<a href="qstyleoption.html#tab">tab</a>()
|
---|
| 809 | </ul>
|
---|
| 810 | <td valign="top" colspan="1" rowspan="2"> <em>t</em> is the <a href="qtab.html">QTab</a> being drawn.
|
---|
| 811 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Selected</a> <td valign="top">Set if the tab is the current tab.
|
---|
| 812 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="2"> <a href="#ControlElement-enum">CE_ProgressBarGroove</a>(const <a href="qprogressbar.html">QProgressBar</a> *)
|
---|
| 813 | <p> and
|
---|
| 814 | <p> <a href="#ControlElement-enum">CE_ProgressBarContents</a>(const QProgressBar *)
|
---|
| 815 | <p> and
|
---|
| 816 | <p> <a href="#ControlElement-enum">CE_ProgressBarLabel</a>(const QProgressBar *)
|
---|
| 817 | <p> <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the progressbar is enabled.
|
---|
| 818 | <td valign="top" colspan="1" rowspan="2"> Unused.
|
---|
| 819 | <td valign="top" colspan="1" rowspan="2">
|
---|
| 820 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the progressbar has input focus.
|
---|
| 821 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="3"> <a href="#ControlElement-enum">CE_PopupMenuItem</a>(const <a href="qpopupmenu.html">QPopupMenu</a> *)
|
---|
| 822 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the menuitem is enabled.
|
---|
| 823 | <td valign="top" colspan="1" rowspan="3"> <a href="qstyleoption.html">QStyleOption</a> ( QMenuItem *mi, int tabwidth, int maxpmwidth )
|
---|
| 824 | <ul>
|
---|
| 825 | <li> opt.<a href="qstyleoption.html#menuItem">menuItem</a>()
|
---|
| 826 | <li> opt.<a href="qstyleoption.html#tabWidth">tabWidth</a>()
|
---|
| 827 | <li> opt.<a href="qstyleoption.html#maxIconWidth">maxIconWidth</a>()
|
---|
| 828 | </ul>
|
---|
| 829 | <td valign="top"><em>mi</em> is the menu item being drawn. QMenuItem is currently an
|
---|
| 830 | internal class.
|
---|
| 831 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Active</a> <td valign="top">Set if the menuitem is the current item.
|
---|
| 832 | <td valign="top"><em>tabwidth</em> is the width of the tab column where key accelerators
|
---|
| 833 | are drawn.
|
---|
| 834 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the menuitem is down (i.e., the mouse button
|
---|
| 835 | or space bar is pressed).
|
---|
| 836 | <td valign="top"><em>maxpmwidth</em> is the maximum width of the check column where
|
---|
| 837 | checkmarks and iconsets are drawn.
|
---|
| 838 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="4"> <a href="#ControlElement-enum">CE_MenuBarItem</a>(const <a href="qmenubar.html">QMenuBar</a> *)
|
---|
| 839 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the menuitem is enabled
|
---|
| 840 | <td valign="top" colspan="1" rowspan="4"> <a href="qstyleoption.html">QStyleOption</a> ( QMenuItem *mi )
|
---|
| 841 | <ul>
|
---|
| 842 | <li> opt.<a href="qstyleoption.html#menuItem">menuItem</a>()
|
---|
| 843 | </ul>
|
---|
| 844 | <td valign="top" colspan="1" rowspan="4"> <em>mi</em> is the menu item being drawn.
|
---|
| 845 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Active</a> <td valign="top">Set if the menuitem is the current item.
|
---|
| 846 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the menuitem is down (i.e., a mouse button or
|
---|
| 847 | the space bar is pressed).
|
---|
| 848 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the menubar has input focus.
|
---|
| 849 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="7"> <a href="#ControlElement-enum">CE_ToolButtonLabel</a>(const <a href="qtoolbutton.html">QToolButton</a> *)
|
---|
| 850 | <td valign="top"><a href="#StyleFlags-enum">Style_Enabled</a> <td valign="top">Set if the toolbutton is enabled.
|
---|
| 851 | <td valign="top" colspan="1" rowspan="7"> <a href="qstyleoption.html">QStyleOption</a> ( <a href="qt.html#ArrowType-enum">ArrowType</a> t )
|
---|
| 852 | <ul>
|
---|
| 853 | <li> opt.<a href="qstyleoption.html#arrowType">arrowType</a>()
|
---|
| 854 | </ul>
|
---|
| 855 | <td valign="top" colspan="1" rowspan="7"> When the tool button only contains an arrow, <em>t</em> is the
|
---|
| 856 | arrow's type.
|
---|
| 857 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_HasFocus</a> <td valign="top">Set if the toolbutton has input focus.
|
---|
| 858 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Down</a> <td valign="top">Set if the toolbutton is down (i.e., a
|
---|
| 859 | mouse button or the space is pressed).
|
---|
| 860 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_On</a> <td valign="top">Set if the toolbutton is a toggle button
|
---|
| 861 | and is toggled on.
|
---|
| 862 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_AutoRaise</a> <td valign="top">Set if the toolbutton has auto-raise enabled.
|
---|
| 863 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_MouseOver</a> <td valign="top">Set if the mouse pointer is over the toolbutton.
|
---|
| 864 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StyleFlags-enum">Style_Raised</a> <td valign="top">Set if the button is not down, not on and doesn't
|
---|
| 865 | contain the mouse when auto-raise is enabled.
|
---|
| 866 | </table></center>
|
---|
| 867 | <p> <p>See also <a href="#ControlElement-enum">ControlElement</a> and <a href="#StyleFlags-enum">StyleFlags</a>.
|
---|
| 868 |
|
---|
| 869 | <h3 class=fn>void <a name="drawControlMask"></a>QStyle::drawControlMask ( <a href="qstyle.html#ControlElement-enum">ControlElement</a> element, <a href="qpainter.html">QPainter</a> * p, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qrect.html">QRect</a> & r, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 870 | </h3>
|
---|
| 871 |
|
---|
| 872 | <p> Draw a bitmask for the ControlElement <em>element</em> using the painter
|
---|
| 873 | <em>p</em> in the area <em>r</em>. See <a href="#drawControl">drawControl</a>() for an explanation of the
|
---|
| 874 | use of the <em>widget</em> and <em>opt</em> arguments.
|
---|
| 875 | <p> The rect <em>r</em> should be in screen coordinates.
|
---|
| 876 | <p> <p>See also <a href="#drawControl">drawControl</a>() and <a href="#ControlElement-enum">ControlElement</a>.
|
---|
| 877 |
|
---|
| 878 | <h3 class=fn>void <a name="drawItem"></a>QStyle::drawItem ( <a href="qpainter.html">QPainter</a> * p, const <a href="qrect.html">QRect</a> & r, int flags, const <a href="qcolorgroup.html">QColorGroup</a> & g, bool enabled, const <a href="qpixmap.html">QPixmap</a> * pixmap, const <a href="qstring.html">QString</a> & text, int len = -1, const <a href="qcolor.html">QColor</a> * penColor = 0 ) const<tt> [virtual]</tt>
|
---|
| 879 | </h3>
|
---|
| 880 | Draws the <em>text</em> or <em>pixmap</em> in rectangle <em>r</em> using painter <em>p</em> and color group <em>g</em>. The pen color is specified with <em>penColor</em>. The <em>enabled</em> bool indicates whether or not the item is
|
---|
| 881 | enabled; when reimplementing this bool should influence how the
|
---|
| 882 | item is drawn. If <em>len</em> is -1 (the default) all the <em>text</em> is
|
---|
| 883 | drawn; otherwise only the first <em>len</em> characters of <em>text</em> are
|
---|
| 884 | drawn. The text is aligned and wrapped according to the alignment
|
---|
| 885 | <em>flags</em> (see <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>).
|
---|
| 886 | <p> By default, if both the text and the pixmap are not null, the
|
---|
| 887 | pixmap is drawn and the text is ignored.
|
---|
| 888 |
|
---|
| 889 | <h3 class=fn>void <a name="drawPrimitive"></a>QStyle::drawPrimitive ( <a href="qstyle.html#PrimitiveElement-enum">PrimitiveElement</a> pe, <a href="qpainter.html">QPainter</a> * p, const <a href="qrect.html">QRect</a> & r, const <a href="qcolorgroup.html">QColorGroup</a> & cg, SFlags flags = Style_Default, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 890 | </h3>
|
---|
| 891 |
|
---|
| 892 | <p> Draws the style PrimitiveElement <em>pe</em> using the painter <em>p</em> in
|
---|
| 893 | the area <em>r</em>. Colors are used from the color group <em>cg</em>.
|
---|
| 894 | <p> The rect <em>r</em> should be in screen coordinates.
|
---|
| 895 | <p> The <em>flags</em> argument is used to control how the PrimitiveElement
|
---|
| 896 | is drawn. Multiple flags can be OR'ed together.
|
---|
| 897 | <p> For example, a pressed button would be drawn with the flags <a href="#StyleFlags-enum">Style_Enabled</a> and <a href="#StyleFlags-enum">Style_Down</a>.
|
---|
| 898 | <p> The <em>opt</em> argument can be used to control how various
|
---|
| 899 | PrimitiveElements are drawn. Note that <em>opt</em> may be the default
|
---|
| 900 | value even for PrimitiveElements that make use of extra options.
|
---|
| 901 | When <em>opt</em> is non-default, it is used as follows:
|
---|
| 902 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 903 | <tr bgcolor="#a2c511"> <th valign="top">PrimitiveElement <th valign="top">Options <th valign="top">Notes
|
---|
| 904 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PrimitiveElement-enum">PE_FocusRect</a>
|
---|
| 905 | <td valign="top"><a href="qstyleoption.html">QStyleOption</a> ( const <a href="qcolor.html">QColor</a> & bg )
|
---|
| 906 | <ul>
|
---|
| 907 | <li> opt.<a href="qstyleoption.html#color">color</a>()
|
---|
| 908 | </ul>
|
---|
| 909 | <td valign="top"><em>bg</em> is the background color on which the focus rect is being drawn.
|
---|
| 910 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="2"> <a href="#PrimitiveElement-enum">PE_Panel</a>
|
---|
| 911 | <td valign="top" colspan="1" rowspan="2"> <a href="qstyleoption.html">QStyleOption</a> ( int linewidth, int midlinewidth )
|
---|
| 912 | <ul>
|
---|
| 913 | <li> opt.<a href="qstyleoption.html#lineWidth">lineWidth</a>()
|
---|
| 914 | <li> opt.<a href="qstyleoption.html#midLineWidth">midLineWidth</a>()
|
---|
| 915 | </ul>
|
---|
| 916 | <td valign="top"><em>linewidth</em> is the line width for drawing the panel.
|
---|
| 917 | <tr bgcolor="#d0d0d0"> <td valign="top"><em>midlinewidth</em> is the mid-line width for drawing the panel.
|
---|
| 918 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="2"> <a href="#PrimitiveElement-enum">PE_PanelPopup</a>
|
---|
| 919 | <td valign="top" colspan="1" rowspan="2"> <a href="qstyleoption.html">QStyleOption</a> ( int linewidth, int midlinewidth )
|
---|
| 920 | <ul>
|
---|
| 921 | <li> opt.<a href="qstyleoption.html#lineWidth">lineWidth</a>()
|
---|
| 922 | <li> opt.<a href="qstyleoption.html#midLineWidth">midLineWidth</a>()
|
---|
| 923 | </ul>
|
---|
| 924 | <td valign="top"><em>linewidth</em> is the line width for drawing the panel.
|
---|
| 925 | <tr bgcolor="#f0f0f0"> <td valign="top"><em>midlinewidth</em> is the mid-line width for drawing the panel.
|
---|
| 926 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="2"> <a href="#PrimitiveElement-enum">PE_PanelMenuBar</a>
|
---|
| 927 | <td valign="top" colspan="1" rowspan="2"> <a href="qstyleoption.html">QStyleOption</a> ( int linewidth, int midlinewidth )
|
---|
| 928 | <ul>
|
---|
| 929 | <li> opt.<a href="qstyleoption.html#lineWidth">lineWidth</a>()
|
---|
| 930 | <li> opt.<a href="qstyleoption.html#midLineWidth">midLineWidth</a>()
|
---|
| 931 | </ul>
|
---|
| 932 | <td valign="top"><em>linewidth</em> is the line width for drawing the panel.
|
---|
| 933 | <tr bgcolor="#d0d0d0"> <td valign="top"><em>midlinewidth</em> is the mid-line width for drawing the panel.
|
---|
| 934 | <tr bgcolor="#f0f0f0"> <td valign="top" colspan="1" rowspan="2"> <a href="#PrimitiveElement-enum">PE_PanelDockWindow</a>
|
---|
| 935 | <td valign="top" colspan="1" rowspan="2"> <a href="qstyleoption.html">QStyleOption</a> ( int linewidth, int midlinewidth )
|
---|
| 936 | <ul>
|
---|
| 937 | <li> opt.<a href="qstyleoption.html#lineWidth">lineWidth</a>()
|
---|
| 938 | <li> opt.<a href="qstyleoption.html#midLineWidth">midLineWidth</a>()
|
---|
| 939 | </ul>
|
---|
| 940 | <td valign="top"><em>linewidth</em> is the line width for drawing the panel.
|
---|
| 941 | <tr bgcolor="#f0f0f0"> <td valign="top"><em>midlinewidth</em> is the mid-line width for drawing the panel.
|
---|
| 942 | <tr bgcolor="#d0d0d0"> <td valign="top" colspan="1" rowspan="4"> <a href="#PrimitiveElement-enum">PE_GroupBoxFrame</a>
|
---|
| 943 | <td valign="top" colspan="1" rowspan="4"> <a href="qstyleoption.html">QStyleOption</a> ( int linewidth, int midlinewidth, int shape, int shadow )
|
---|
| 944 | <ul>
|
---|
| 945 | <li> opt.<a href="qstyleoption.html#lineWidth">lineWidth</a>()
|
---|
| 946 | <li> opt.<a href="qstyleoption.html#midLineWidth">midLineWidth</a>()
|
---|
| 947 | <li> opt.<a href="qstyleoption.html#frameShape">frameShape</a>()
|
---|
| 948 | <li> opt.<a href="qstyleoption.html#frameShadow">frameShadow</a>()
|
---|
| 949 | </ul>
|
---|
| 950 | <td valign="top"><em>linewidth</em> is the line width for the group box.
|
---|
| 951 | <tr bgcolor="#d0d0d0"> <td valign="top"><em>midlinewidth</em> is the mid-line width for the group box.
|
---|
| 952 | <tr bgcolor="#d0d0d0"> <td valign="top"><em>shape</em> is the <a href="qframe.html#frameShape-prop">frame shape</a>
|
---|
| 953 | for the group box.
|
---|
| 954 | <tr bgcolor="#d0d0d0"> <td valign="top"><em>shadow</em> is the <a href="qframe.html#frameShadow-prop">frame shadow</a>
|
---|
| 955 | for the group box.
|
---|
| 956 | </table></center>
|
---|
| 957 | <p> For all other <a href="#PrimitiveElement-enum">PrimitiveElements</a>, <em>opt</em> is unused.
|
---|
| 958 | <p> <p>See also <a href="#StyleFlags-enum">StyleFlags</a>.
|
---|
| 959 |
|
---|
| 960 | <p>Example: <a href="themes-example.html#x248">themes/wood.cpp</a>.
|
---|
| 961 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="itemRect"></a>QStyle::itemRect ( <a href="qpainter.html">QPainter</a> * p, const <a href="qrect.html">QRect</a> & r, int flags, bool enabled, const <a href="qpixmap.html">QPixmap</a> * pixmap, const <a href="qstring.html">QString</a> & text, int len = -1 ) const<tt> [virtual]</tt>
|
---|
| 962 | </h3>
|
---|
| 963 | Returns the appropriate area (see below) within rectangle <em>r</em> in
|
---|
| 964 | which to draw the <em>text</em> or <em>pixmap</em> using painter <em>p</em>. If <em>len</em> is -1 (the default) all the <em>text</em> is drawn; otherwise only
|
---|
| 965 | the first <em>len</em> characters of <em>text</em> are drawn. The text is
|
---|
| 966 | aligned in accordance with the alignment <em>flags</em> (see
|
---|
| 967 | <a href="qt.html#AlignmentFlags-enum">Qt::AlignmentFlags</a>). The <em>enabled</em> bool indicates whether or
|
---|
| 968 | not the item is enabled.
|
---|
| 969 | <p> If <em>r</em> is larger than the area needed to render the <em>text</em> the
|
---|
| 970 | rectangle that is returned will be offset within <em>r</em> in
|
---|
| 971 | accordance with the alignment <em>flags</em>. For example if <em>flags</em> is
|
---|
| 972 | <a href="qt.html#AlignmentFlags-enum">AlignCenter</a> the returned rectangle will be centered within <em>r</em>. If <em>r</em> is smaller than the area needed the rectangle that is
|
---|
| 973 | returned will be <em>larger</em> than <em>r</em> (the smallest rectangle large
|
---|
| 974 | enough to render the <em>text</em> or <em>pixmap</em>).
|
---|
| 975 | <p> By default, if both the text and the pixmap are not null, the
|
---|
| 976 | pixmap is drawn and the text is ignored.
|
---|
| 977 |
|
---|
| 978 | <h3 class=fn>int <a name="pixelMetric"></a>QStyle::pixelMetric ( <a href="qstyle.html#PixelMetric-enum">PixelMetric</a> metric, const <a href="qwidget.html">QWidget</a> * widget = 0 ) const<tt> [pure virtual]</tt>
|
---|
| 979 | </h3>
|
---|
| 980 |
|
---|
| 981 | <p> Returns the pixel metric for <em>metric</em>. The <em>widget</em> argument is
|
---|
| 982 | a pointer to a <a href="qwidget.html">QWidget</a> or one of its subclasses. The widget can be
|
---|
| 983 | cast to the appropriate type based on the value of <em>metric</em>. Note
|
---|
| 984 | that <em>widget</em> may be zero even for PixelMetrics that can make use
|
---|
| 985 | of <em>widget</em>. See the table below for the appropriate <em>widget</em>
|
---|
| 986 | casts:
|
---|
| 987 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 988 | <tr bgcolor="#a2c511"> <th valign="top">PixelMetric <th valign="top">Widget Cast
|
---|
| 989 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PixelMetric-enum">PM_SliderControlThickness</a> <td valign="top">(const <a href="qslider.html">QSlider</a> *)
|
---|
| 990 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#PixelMetric-enum">PM_SliderLength</a> <td valign="top">(const <a href="qslider.html">QSlider</a> *)
|
---|
| 991 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PixelMetric-enum">PM_SliderTickmarkOffset</a> <td valign="top">(const <a href="qslider.html">QSlider</a> *)
|
---|
| 992 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#PixelMetric-enum">PM_SliderSpaceAvailable</a> <td valign="top">(const <a href="qslider.html">QSlider</a> *)
|
---|
| 993 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PixelMetric-enum">PM_TabBarTabOverlap</a> <td valign="top">(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 994 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#PixelMetric-enum">PM_TabBarTabHSpace</a> <td valign="top">(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 995 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PixelMetric-enum">PM_TabBarTabVSpace</a> <td valign="top">(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 996 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#PixelMetric-enum">PM_TabBarBaseHeight</a> <td valign="top">(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 997 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#PixelMetric-enum">PM_TabBarBaseOverlap</a> <td valign="top">(const <a href="qtabbar.html">QTabBar</a> *)
|
---|
| 998 | </table></center>
|
---|
| 999 |
|
---|
| 1000 | <h3 class=fn>void <a name="polish"></a>QStyle::polish ( <a href="qwidget.html">QWidget</a> * )<tt> [virtual]</tt>
|
---|
| 1001 | </h3>
|
---|
| 1002 | Initializes the appearance of a widget.
|
---|
| 1003 | <p> This function is called for every widget at some point after it
|
---|
| 1004 | has been fully created but just <em>before</em> it is shown the very
|
---|
| 1005 | first time.
|
---|
| 1006 | <p> Reasonable actions in this function might be to call
|
---|
| 1007 | <a href="qwidget.html#setBackgroundMode">QWidget::setBackgroundMode</a>() for the widget. An example of highly
|
---|
| 1008 | unreasonable use would be setting the geometry! Reimplementing
|
---|
| 1009 | this function gives you a back-door through which you can change
|
---|
| 1010 | the appearance of a widget. With Qt 3.0's style engine you will
|
---|
| 1011 | rarely need to write your own <a href="#polish">polish</a>(); instead reimplement
|
---|
| 1012 | <a href="#drawItem">drawItem</a>(), <a href="#drawPrimitive">drawPrimitive</a>(), etc.
|
---|
| 1013 | <p> The <a href="qobject.html#inherits">QWidget::inherits</a>() function may provide enough information to
|
---|
| 1014 | allow class-specific customizations. But be careful not to
|
---|
| 1015 | hard-code things too much because new QStyle subclasses are
|
---|
| 1016 | expected to work reasonably with all current and <em>future</em>
|
---|
| 1017 | widgets.
|
---|
| 1018 | <p> <p>See also <a href="#unPolish">unPolish</a>().
|
---|
| 1019 |
|
---|
| 1020 | <h3 class=fn>void <a name="polish-2"></a>QStyle::polish ( <a href="qapplication.html">QApplication</a> * )<tt> [virtual]</tt>
|
---|
| 1021 | </h3>
|
---|
| 1022 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 1023 | <p> Late initialization of the <a href="qapplication.html">QApplication</a> object.
|
---|
| 1024 | <p> <p>See also <a href="#unPolish">unPolish</a>().
|
---|
| 1025 |
|
---|
| 1026 | <h3 class=fn>void <a name="polish-3"></a>QStyle::polish ( <a href="qpalette.html">QPalette</a> & )<tt> [virtual]</tt>
|
---|
| 1027 | </h3>
|
---|
| 1028 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 1029 | <p> The style may have certain requirements for color palettes. In
|
---|
| 1030 | this function it has the chance to change the palette according to
|
---|
| 1031 | these requirements.
|
---|
| 1032 | <p> <p>See also <a href="qpalette.html">QPalette</a> and <a href="qapplication.html#setPalette">QApplication::setPalette</a>().
|
---|
| 1033 |
|
---|
| 1034 | <h3 class=fn>void <a name="polishPopupMenu"></a>QStyle::polishPopupMenu ( <a href="qpopupmenu.html">QPopupMenu</a> * )<tt> [pure virtual]</tt>
|
---|
| 1035 | </h3>
|
---|
| 1036 | Polishes the popup menu according to the GUI style. This usually
|
---|
| 1037 | means setting the mouse tracking
|
---|
| 1038 | (<a href="qwidget.html#setMouseTracking">QPopupMenu::setMouseTracking</a>()) and whether the menu is
|
---|
| 1039 | checkable by default (<a href="qpopupmenu.html#setCheckable">QPopupMenu::setCheckable</a>()).
|
---|
| 1040 |
|
---|
| 1041 | <h3 class=fn><a href="qstyle.html#SubControl-enum">SubControl</a> <a name="querySubControl"></a>QStyle::querySubControl ( <a href="qstyle.html#ComplexControl-enum">ComplexControl</a> control, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qpoint.html">QPoint</a> & pos, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 1042 | </h3>
|
---|
| 1043 |
|
---|
| 1044 | <p> Returns the SubControl for <em>widget</em> at the point <em>pos</em>. The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 1045 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 1046 | on the value of <em>control</em>. The <em>opt</em> argument can be used to
|
---|
| 1047 | pass extra information required when drawing the ComplexControl.
|
---|
| 1048 | Note that <em>opt</em> may be the default value even for ComplexControls
|
---|
| 1049 | that can make use of the extra options. See <a href="#drawComplexControl">drawComplexControl</a>()
|
---|
| 1050 | for an explanation of the <em>widget</em> and <em>opt</em> arguments.
|
---|
| 1051 | <p> Note that <em>pos</em> is passed in screen coordinates. When using
|
---|
| 1052 | <a href="#querySubControlMetrics">querySubControlMetrics</a>() to check for hits and misses, use
|
---|
| 1053 | <a href="#visualRect">visualRect</a>() to change the logical coordinates into screen
|
---|
| 1054 | coordinates.
|
---|
| 1055 | <p> <p>See also <a href="#drawComplexControl">drawComplexControl</a>(), <a href="#ComplexControl-enum">ComplexControl</a>, <a href="#SubControl-enum">SubControl</a>, and <a href="#querySubControlMetrics">querySubControlMetrics</a>().
|
---|
| 1056 |
|
---|
| 1057 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="querySubControlMetrics"></a>QStyle::querySubControlMetrics ( <a href="qstyle.html#ComplexControl-enum">ComplexControl</a> control, const <a href="qwidget.html">QWidget</a> * widget, <a href="qstyle.html#SubControl-enum">SubControl</a> subcontrol, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 1058 | </h3>
|
---|
| 1059 |
|
---|
| 1060 | <p> Returns the rect for the SubControl <em>subcontrol</em> for <em>widget</em> in
|
---|
| 1061 | logical coordinates.
|
---|
| 1062 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 1063 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 1064 | on the value of <em>control</em>. The <em>opt</em> argument can be used to
|
---|
| 1065 | pass extra information required when drawing the ComplexControl.
|
---|
| 1066 | Note that <em>opt</em> may be the default value even for ComplexControls
|
---|
| 1067 | that can make use of the extra options. See <a href="#drawComplexControl">drawComplexControl</a>()
|
---|
| 1068 | for an explanation of the <em>widget</em> and <em>opt</em> arguments.
|
---|
| 1069 | <p> <p>See also <a href="#drawComplexControl">drawComplexControl</a>(), <a href="#ComplexControl-enum">ComplexControl</a>, and <a href="#SubControl-enum">SubControl</a>.
|
---|
| 1070 |
|
---|
| 1071 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="scrollBarExtent"></a>QStyle::scrollBarExtent () const
|
---|
| 1072 | </h3>
|
---|
| 1073 |
|
---|
| 1074 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 1075 | <p>
|
---|
| 1076 | <h3 class=fn><a href="qsize.html">QSize</a> <a name="sizeFromContents"></a>QStyle::sizeFromContents ( <a href="qstyle.html#ContentsType-enum">ContentsType</a> contents, const <a href="qwidget.html">QWidget</a> * widget, const <a href="qsize.html">QSize</a> & contentsSize, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 1077 | </h3>
|
---|
| 1078 |
|
---|
| 1079 | <p> Returns the size of <em>widget</em> based on the contents size <em>contentsSize</em>.
|
---|
| 1080 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 1081 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 1082 | on the value of <em>contents</em>. The <em>opt</em> argument can be used to
|
---|
| 1083 | pass extra information required when calculating the size. Note
|
---|
| 1084 | that <em>opt</em> may be the default value even for ContentsTypes that
|
---|
| 1085 | can make use of the extra options. See the table below for the
|
---|
| 1086 | appropriate <em>widget</em> and <em>opt</em> usage:
|
---|
| 1087 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 1088 | <tr bgcolor="#a2c511"> <th valign="top">ContentsType <th valign="top">Widget Cast <th valign="top">Options <th valign="top">Notes
|
---|
| 1089 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ContentsType-enum">CT_PushButton</a> <td valign="top">(const <a href="qpushbutton.html">QPushButton</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1090 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ContentsType-enum">CT_CheckBox</a> <td valign="top">(const <a href="qcheckbox.html">QCheckBox</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1091 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ContentsType-enum">CT_RadioButton</a> <td valign="top">(const <a href="qradiobutton.html">QRadioButton</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1092 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ContentsType-enum">CT_ToolButton</a> <td valign="top">(const <a href="qtoolbutton.html">QToolButton</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1093 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ContentsType-enum">CT_ComboBox</a> <td valign="top">(const <a href="qcombobox.html">QComboBox</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1094 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ContentsType-enum">CT_Splitter</a> <td valign="top">(const <a href="qsplitter.html">QSplitter</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1095 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ContentsType-enum">CT_DockWindow</a> <td valign="top">(const <a href="qdockwindow.html">QDockWindow</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1096 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#ContentsType-enum">CT_ProgressBar</a> <td valign="top">(const <a href="qprogressbar.html">QProgressBar</a> *) <td valign="top">Unused. <td valign="top">
|
---|
| 1097 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#ContentsType-enum">CT_PopupMenuItem</a> <td valign="top">(const <a href="qpopupmenu.html">QPopupMenu</a> *)
|
---|
| 1098 | <td valign="top"><a href="qstyleoption.html">QStyleOption</a> ( QMenuItem *mi )
|
---|
| 1099 | <ul>
|
---|
| 1100 | <li> opt.<a href="qstyleoption.html#menuItem">menuItem</a>()
|
---|
| 1101 | </ul>
|
---|
| 1102 | <td valign="top"><em>mi</em> is the menu item to use when calculating the size.
|
---|
| 1103 | QMenuItem is currently an internal class.
|
---|
| 1104 | </table></center>
|
---|
| 1105 |
|
---|
| 1106 | <h3 class=fn>int <a name="styleHint"></a>QStyle::styleHint ( <a href="qstyle.html#StyleHint-enum">StyleHint</a> stylehint, const <a href="qwidget.html">QWidget</a> * widget = 0, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default, QStyleHintReturn * returnData = 0 ) const<tt> [pure virtual]</tt>
|
---|
| 1107 | </h3>
|
---|
| 1108 |
|
---|
| 1109 | <p> Returns the style hint <em>stylehint</em> for <em>widget</em>. Currently, <em>widget</em>, <em>opt</em>, and <em>returnData</em> are unused; they're included to
|
---|
| 1110 | allow for future enhancements.
|
---|
| 1111 | <p> For an explanation of the return value see <a href="#StyleHint-enum">StyleHint</a>.
|
---|
| 1112 |
|
---|
| 1113 | <h3 class=fn><a href="qpixmap.html">QPixmap</a> <a name="stylePixmap"></a>QStyle::stylePixmap ( <a href="qstyle.html#StylePixmap-enum">StylePixmap</a> stylepixmap, const <a href="qwidget.html">QWidget</a> * widget = 0, const <a href="qstyleoption.html">QStyleOption</a> & opt = QStyleOption::Default ) const<tt> [pure virtual]</tt>
|
---|
| 1114 | </h3>
|
---|
| 1115 |
|
---|
| 1116 | <p> Returns a pixmap for <em>stylepixmap</em>.
|
---|
| 1117 | <p> The <em>opt</em> argument can be used to pass extra information required
|
---|
| 1118 | when drawing the ControlElement. Note that <em>opt</em> may be the
|
---|
| 1119 | default value even for StylePixmaps that can make use of the extra
|
---|
| 1120 | options. Currently, the <em>opt</em> argument is unused.
|
---|
| 1121 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 1122 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 1123 | on the value of <em>stylepixmap</em>. See the table below for the
|
---|
| 1124 | appropriate <em>widget</em> casts:
|
---|
| 1125 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 1126 | <tr bgcolor="#a2c511"> <th valign="top">StylePixmap <th valign="top">Widget Cast
|
---|
| 1127 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarMinButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1128 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarMaxButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1129 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarCloseButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1130 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarNormalButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1131 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarShadeButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1132 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#StylePixmap-enum">SP_TitleBarUnshadeButton</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1133 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#StylePixmap-enum">SP_DockWindowCloseButton</a> <td valign="top">(const <a href="qdockwindow.html">QDockWindow</a> *)
|
---|
| 1134 | </table></center>
|
---|
| 1135 | <p> <p>See also <a href="#StylePixmap-enum">StylePixmap</a>.
|
---|
| 1136 |
|
---|
| 1137 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="subRect"></a>QStyle::subRect ( <a href="qstyle.html#SubRect-enum">SubRect</a> subrect, const <a href="qwidget.html">QWidget</a> * widget ) const<tt> [pure virtual]</tt>
|
---|
| 1138 | </h3>
|
---|
| 1139 |
|
---|
| 1140 | <p> Returns the sub-area <em>subrect</em> for the <em>widget</em> in logical
|
---|
| 1141 | coordinates.
|
---|
| 1142 | <p> The <em>widget</em> argument is a pointer to a <a href="qwidget.html">QWidget</a> or one of its
|
---|
| 1143 | subclasses. The widget can be cast to the appropriate type based
|
---|
| 1144 | on the value of <em>subrect</em>. See the table below for the
|
---|
| 1145 | appropriate <em>widget</em> casts:
|
---|
| 1146 | <p> <center><table cellpadding="4" cellspacing="2" border="0">
|
---|
| 1147 | <tr bgcolor="#a2c511"> <th valign="top">SubRect <th valign="top">Widget Cast
|
---|
| 1148 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_PushButtonContents</a> <td valign="top">(const <a href="qpushbutton.html">QPushButton</a> *)
|
---|
| 1149 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_PushButtonFocusRect</a> <td valign="top">(const <a href="qpushbutton.html">QPushButton</a> *)
|
---|
| 1150 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_CheckBoxIndicator</a> <td valign="top">(const <a href="qcheckbox.html">QCheckBox</a> *)
|
---|
| 1151 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_CheckBoxContents</a> <td valign="top">(const <a href="qcheckbox.html">QCheckBox</a> *)
|
---|
| 1152 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_CheckBoxFocusRect</a> <td valign="top">(const <a href="qcheckbox.html">QCheckBox</a> *)
|
---|
| 1153 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_RadioButtonIndicator</a> <td valign="top">(const <a href="qradiobutton.html">QRadioButton</a> *)
|
---|
| 1154 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_RadioButtonContents</a> <td valign="top">(const <a href="qradiobutton.html">QRadioButton</a> *)
|
---|
| 1155 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_RadioButtonFocusRect</a> <td valign="top">(const <a href="qradiobutton.html">QRadioButton</a> *)
|
---|
| 1156 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_ComboBoxFocusRect</a> <td valign="top">(const <a href="qcombobox.html">QComboBox</a> *)
|
---|
| 1157 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_DockWindowHandleRect</a> <td valign="top">(const <a href="qwidget.html">QWidget</a> *)
|
---|
| 1158 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_ProgressBarGroove</a> <td valign="top">(const <a href="qprogressbar.html">QProgressBar</a> *)
|
---|
| 1159 | <tr bgcolor="#d0d0d0"> <td valign="top"><a href="#SubRect-enum">SR_ProgressBarContents</a> <td valign="top">(const <a href="qprogressbar.html">QProgressBar</a> *)
|
---|
| 1160 | <tr bgcolor="#f0f0f0"> <td valign="top"><a href="#SubRect-enum">SR_ProgressBarLabel</a> <td valign="top">(const <a href="qprogressbar.html">QProgressBar</a> *)
|
---|
| 1161 | </table></center>
|
---|
| 1162 | <p> The tear-off handle (SR_DockWindowHandleRect) for <a href="qdockwindow.html">QDockWindow</a>
|
---|
| 1163 | is a private class. Use <a href="qwidget.html#parentWidget">QWidget::parentWidget</a>() to access the
|
---|
| 1164 | QDockWindow:
|
---|
| 1165 | <p> <pre>
|
---|
| 1166 | if ( !widget->parentWidget() )
|
---|
| 1167 | return;
|
---|
| 1168 | const <a href="qdockwindow.html">QDockWindow</a> *dw = (const <a href="qdockwindow.html">QDockWindow</a> *) widget->parentWidget();
|
---|
| 1169 | </pre>
|
---|
| 1170 |
|
---|
| 1171 | <p> <p>See also <a href="#SubRect-enum">SubRect</a>.
|
---|
| 1172 |
|
---|
| 1173 | <h3 class=fn>void <a name="tabbarMetrics"></a>QStyle::tabbarMetrics ( const <a href="qwidget.html">QWidget</a> * t, int & hf, int & vf, int & ov ) const
|
---|
| 1174 | </h3>
|
---|
| 1175 |
|
---|
| 1176 | <b>This function is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
|
---|
| 1177 | <p>
|
---|
| 1178 | <h3 class=fn>void <a name="unPolish"></a>QStyle::unPolish ( <a href="qwidget.html">QWidget</a> * )<tt> [virtual]</tt>
|
---|
| 1179 | </h3>
|
---|
| 1180 | Undoes the initialization of a widget's appearance.
|
---|
| 1181 | <p> This function is the counterpart to polish. It is called for every
|
---|
| 1182 | polished widget when the style is dynamically changed. The former
|
---|
| 1183 | style has to unpolish its settings before the new style can polish
|
---|
| 1184 | them again.
|
---|
| 1185 | <p> <p>See also <a href="#polish">polish</a>().
|
---|
| 1186 |
|
---|
| 1187 | <h3 class=fn>void <a name="unPolish-2"></a>QStyle::unPolish ( <a href="qapplication.html">QApplication</a> * )<tt> [virtual]</tt>
|
---|
| 1188 | </h3>
|
---|
| 1189 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 1190 | <p> Undoes the application polish.
|
---|
| 1191 | <p> <p>See also <a href="#polish">polish</a>().
|
---|
| 1192 |
|
---|
| 1193 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="visualRect"></a>QStyle::visualRect ( const <a href="qrect.html">QRect</a> & logical, const <a href="qwidget.html">QWidget</a> * w )<tt> [static]</tt>
|
---|
| 1194 | </h3>
|
---|
| 1195 |
|
---|
| 1196 | <p> Returns the rect <em>logical</em> in screen coordinates. The bounding
|
---|
| 1197 | rect for widget <em>w</em> is used to perform the translation. This
|
---|
| 1198 | function is provided to aid style implementors in supporting
|
---|
| 1199 | right-to-left mode.
|
---|
| 1200 | <p> <p>See also <a href="qapplication.html#reverseLayout">QApplication::reverseLayout</a>().
|
---|
| 1201 |
|
---|
| 1202 | <h3 class=fn><a href="qrect.html">QRect</a> <a name="visualRect-2"></a>QStyle::visualRect ( const <a href="qrect.html">QRect</a> & logical, const <a href="qrect.html">QRect</a> & bounding )<tt> [static]</tt>
|
---|
| 1203 | </h3>
|
---|
| 1204 | This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
|
---|
| 1205 | <p> Returns the rect <em>logical</em> in screen coordinates. The rect <em>bounding</em> is used to perform the translation. This function is
|
---|
| 1206 | provided to aid style implementors in supporting right-to-left
|
---|
| 1207 | mode.
|
---|
| 1208 | <p> <p>See also <a href="qapplication.html#reverseLayout">QApplication::reverseLayout</a>().
|
---|
| 1209 |
|
---|
| 1210 | <!-- eof -->
|
---|
| 1211 | <hr><p>
|
---|
| 1212 | This file is part of the <a href="index.html">Qt toolkit</a>.
|
---|
| 1213 | Copyright © 1995-2007
|
---|
| 1214 | <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
|
---|
| 1215 | <table width=100% cellspacing=0 border=0><tr>
|
---|
| 1216 | <td>Copyright © 2007
|
---|
| 1217 | <a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
|
---|
| 1218 | <td align=right><div align=right>Qt 3.3.8</div>
|
---|
| 1219 | </table></div></address></body>
|
---|
| 1220 | </html>
|
---|