Sophie

Sophie

distrib > Mageia > 4 > i586 > by-pkgid > 28b9e36e96ce34b2567ae5b47a27b2c5 > files > 1064

python-qt4-doc-4.10.3-3.mga4.noarch.rpm

<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QStyleOption Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOption Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOption class stores the parameters used by <a href="qstyle.html">QStyle</a> functions. <a href="#details">More...</a></p>

<p>Inherited by <a href="qstyleoptionbutton.html">QStyleOptionButton</a>, <a href="qstyleoptioncomplex.html">QStyleOptionComplex</a>, <a href="qstyleoptiondockwidget.html">QStyleOptionDockWidget</a>, <a href="qstyleoptionfocusrect.html">QStyleOptionFocusRect</a>, <a href="qstyleoptionframe.html">QStyleOptionFrame</a>, <a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a>, <a href="qstyleoptionheader.html">QStyleOptionHeader</a>, <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a>, <a href="qstyleoptionprogressbar.html">QStyleOptionProgressBar</a>, <a href="qstyleoptionrubberband.html">QStyleOptionRubberBand</a>, <a href="qstyleoptiontab.html">QStyleOptionTab</a>, <a href="qstyleoptiontabbarbase.html">QStyleOptionTabBarBase</a>, <a href="qstyleoptiontabwidgetframe.html">QStyleOptionTabWidgetFrame</a>, <a href="qstyleoptiontoolbar.html">QStyleOptionToolBar</a>, <a href="qstyleoptiontoolbox.html">QStyleOptionToolBox</a> and <a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoption.html#OptionType-enum">OptionType</a></b> { SO_Default, SO_FocusRect, SO_Button, SO_Tab, ..., SO_CustomBase }</li><li><div class="fn" />enum <b><a href="qstyleoption.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoption.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoption.html#QStyleOption">__init__</a></b> (<i>self</i>, int&#160;<i>version</i>&#160;=&#160;QStyleOption.Version, int&#160;<i>type</i>&#160;=&#160;QStyleOption.SO_Default)</li><li><div class="fn" /><b><a href="qstyleoption.html#QStyleOption-2">__init__</a></b> (<i>self</i>, QStyleOption&#160;<i>other</i>)</li><li><div class="fn" /><b><a href="qstyleoption.html#init">init</a></b> (<i>self</i>, QWidget&#160;<i>w</i>)</li><li><div class="fn" /><b><a href="qstyleoption.html#initFrom">initFrom</a></b> (<i>self</i>, QWidget&#160;<i>w</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />Qt.LayoutDirection <b><a href="qstyleoption.html#direction-var">direction</a></b></li><li><div class="fn" />QFontMetrics <b><a href="qstyleoption.html#fontMetrics-var">fontMetrics</a></b></li><li><div class="fn" />QPalette <b><a href="qstyleoption.html#palette-var">palette</a></b></li><li><div class="fn" />QRect <b><a href="qstyleoption.html#rect-var">rect</a></b></li><li><div class="fn" />QStyle.State <b><a href="qstyleoption.html#state-var">state</a></b></li><li><div class="fn" />int <b><a href="qstyleoption.html#type-var">type</a></b></li><li><div class="fn" />int <b><a href="qstyleoption.html#version-var">version</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOption class stores the parameters used by <a href="qstyle.html">QStyle</a> functions.</p>
<p>QStyleOption and its subclasses contain all the information that
<a href="qstyle.html">QStyle</a> functions need to draw a graphical
element.</p>
<p>For performance reasons, there are few member functions and the
access to the member variables is direct (i.e., using the
<tt>.</tt> or <tt>-&gt;</tt> operator). This low-level feel makes
the structures straightforward to use and emphasizes that these are
simply parameters used by the style functions.</p>
<p>The caller of a <a href="qstyle.html">QStyle</a> function
usually creates QStyleOption objects on the stack. This combined
with Qt's extensive use of <a href="implicit-sharing.html">implicit
sharing</a> for types such as <a href="qstring.html">QString</a>,
<a href="qpalette.html">QPalette</a>, and <a href="qcolor.html">QColor</a> ensures that no memory allocation
needlessly takes place.</p>
<p>The following code snippet shows how to use a specific
QStyleOption subclass to paint a push button:</p>
<pre class="cpp">
 <span class="type">void</span> MyPushButton<span class="operator">.</span>paintEvent(<span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> <span class="operator">*</span>)
 {
     <span class="type"><a href="qstyleoptionbutton.html">QStyleOptionButton</a></span> option;
     option<span class="operator">.</span>initFrom(<span class="keyword">this</span>);
     option<span class="operator">.</span>state <span class="operator">=</span> isDown() <span class="operator">?</span> <span class="type"><a href="qstyle.html">QStyle</a></span><span class="operator">.</span>State_Sunken : <span class="type"><a href="qstyle.html">QStyle</a></span><span class="operator">.</span>State_Raised;
     <span class="keyword">if</span> (isDefault())
         option<span class="operator">.</span>features <span class="operator">|</span><span class="operator">=</span> <span class="type"><a href="qstyleoptionbutton.html">QStyleOptionButton</a></span><span class="operator">.</span>DefaultButton;
     option<span class="operator">.</span>text <span class="operator">=</span> text();
     option<span class="operator">.</span>icon <span class="operator">=</span> icon();

     <span class="type"><a href="qpainter.html">QPainter</a></span> painter(<span class="keyword">this</span>);
     style()<span class="operator">-</span><span class="operator">&gt;</span>drawControl(<span class="type"><a href="qstyle.html">QStyle</a></span><span class="operator">.</span>CE_PushButton<span class="operator">,</span> <span class="operator">&amp;</span>option<span class="operator">,</span> <span class="operator">&amp;</span>painter<span class="operator">,</span> <span class="keyword">this</span>);
 }
</pre>
<p>In our example, the control is a <a href="qstyle.html#ControlElement-enum">QStyle.CE_PushButton</a>, and
according to the <a href="qstyle.html#drawControl">QStyle.drawControl</a>() documentation
the corresponding class is <a href="qstyleoptionbutton.html">QStyleOptionButton</a>.</p>
<p>When reimplementing <a href="qstyle.html">QStyle</a> functions
that take a QStyleOption parameter, you often need to cast the
QStyleOption to a subclass. For safety, you can use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
ensure that the pointer type is correct. For example:</p>
<pre class="cpp">
 <span class="type">void</span> MyStyle<span class="operator">.</span>drawPrimitive(PrimitiveElement element<span class="operator">,</span>
                             <span class="keyword">const</span> <span class="type">QStyleOption</span> <span class="operator">*</span>option<span class="operator">,</span>
                             <span class="type"><a href="qpainter.html">QPainter</a></span> <span class="operator">*</span>painter<span class="operator">,</span>
                             <span class="keyword">const</span> <span class="type"><a href="qwidget.html">QWidget</a></span> <span class="operator">*</span>widget)
 {
     <span class="keyword">if</span> (element <span class="operator">=</span><span class="operator">=</span> PE_FrameFocusRect) {
         <span class="keyword">const</span> <span class="type"><a href="qstyleoptionfocusrect.html">QStyleOptionFocusRect</a></span> <span class="operator">*</span>focusRectOption <span class="operator">=</span>
                 qstyleoption_cast<span class="operator">&lt;</span><span class="keyword">const</span> <span class="type"><a href="qstyleoptionfocusrect.html">QStyleOptionFocusRect</a></span> <span class="operator">*</span><span class="operator">&gt;</span>(option);
         <span class="keyword">if</span> (focusRectOption) {
             <span class="comment">// ...</span>
         }
     }
     <span class="comment">// ...</span>
 }
</pre>
<p>The <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>()
function will return 0 if the object to which <tt>option</tt>
points is not of the correct type.</p>
<p>For an example demonstrating how style options can be used, see
the <a href="widgets-styles.html">Styles</a> example.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="OptionType-enum" />QStyleOption.OptionType</h3><p>This enum is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Button</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign"><a href="qstyleoptionbutton.html">QStyleOptionButton</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ComboBox</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptioncombobox.html">QStyleOptionComboBox</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Complex</tt></td>
<td class="topAlign"><tt>0xf0000</tt></td>
<td class="topAlign"><a href="qstyleoptioncomplex.html">QStyleOptionComplex</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Default</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign"><a href="qstyleoption.html">QStyleOption</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_DockWidget</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign"><a href="qstyleoptiondockwidget.html">QStyleOptionDockWidget</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_FocusRect</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign"><a href="qstyleoptionfocusrect.html">QStyleOptionFocusRect</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Frame</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign"><a href="qstyleoptionframe.html">QStyleOptionFrame</a> <a href="qstyleoptionframev2.html">QStyleOptionFrameV2</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_GraphicsItem</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign"><a href="qstyleoptiongraphicsitem.html">QStyleOptionGraphicsItem</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_GroupBox</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptiongroupbox.html">QStyleOptionGroupBox</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Header</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign"><a href="qstyleoptionheader.html">QStyleOptionHeader</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_MenuItem</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign"><a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ProgressBar</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign"><a href="qstyleoptionprogressbar.html">QStyleOptionProgressBar</a> <a href="qstyleoptionprogressbarv2.html">QStyleOptionProgressBarV2</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_RubberBand</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign"><a href="qstyleoptionrubberband.html">QStyleOptionRubberBand</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_SizeGrip</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptionsizegrip.html">QStyleOptionSizeGrip</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Slider</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptionslider.html">QStyleOptionSlider</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_SpinBox</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptionspinbox.html">QStyleOptionSpinBox</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Tab</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign"><a href="qstyleoptiontab.html">QStyleOptionTab</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_TabBarBase</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign"><a href="qstyleoptiontabbarbase.html">QStyleOptionTabBarBase</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_TabWidgetFrame</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign"><a href="qstyleoptiontabwidgetframe.html">QStyleOptionTabWidgetFrame</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_TitleBar</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptiontitlebar.html">QStyleOptionTitleBar</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ToolBar</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign"><a href="qstyleoptiontoolbar.html">QStyleOptionToolBar</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ToolBox</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign"><a href="qstyleoptiontoolbox.html">QStyleOptionToolBox</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ToolButton</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_ViewItem</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign"><a href="qstyleoptionviewitem.html">QStyleOptionViewItem</a> (used in
Interviews)</td>
</tr>
</table>
<p>The following values are used for custom controls:</p>
<table class="valuelist">
<tr class="even" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_CustomBase</tt></td>
<td class="topAlign"><tt>0xf00</tt></td>
<td class="topAlign">Reserved for custom QStyleOptions; all custom
controls values must be above this value</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOption.SO_ComplexCustomBase</tt></td>
<td class="topAlign"><tt>0xf000000</tt></td>
<td class="topAlign">Reserved for custom QStyleOptions; all custom
complex controls values must be above this value</td>
</tr>
</table>
<p>Some style options are defined for various <a href="qt3support.html">Qt3Support</a> controls:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Q3DockWindow</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign"><a href="qstyleoptionq3dockwindow.html">QStyleOptionQ3DockWindow</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Q3ListView</tt></td>
<td class="topAlign">?</td>
<td class="topAlign"><a href="qstyleoptionq3listview.html">QStyleOptionQ3ListView</a></td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.SO_Q3ListViewItem</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign"><a href="qstyleoptionq3listviewitem.html">QStyleOptionQ3ListViewItem</a></td>
</tr>
</table>
<p><b>See also</b> <a href="qstyleoption.html#type-varx">type</a>.</p>


<h3 class="fn"><a name="StyleOptionType-enum" />QStyleOption.StyleOptionType</h3><p>This enum is used to hold information about the type of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.Type</tt></td>
<td class="topAlign"><tt>SO_Default</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_Default</a> for this
class).</td>
</tr>
</table>
<p>The type is used internally by <a href="qstyleoption.html">QStyleOption</a>, its subclasses, and <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>() to
determine the type of style option. In general you do not need to
worry about this unless you want to create your own <a href="qstyleoption.html">QStyleOption</a> subclass and your own
styles.</p>
<p><b>See also</b> <a href="qstyleoption.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>


<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOption.StyleOptionVersion</h3><p>This enum is used to hold information about the version of the
style option, and is defined for each <a href="qstyleoption.html">QStyleOption</a> subclass.</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOption.Version</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign">1</td>
</tr>
</table>
<p>The version is used by <a href="qstyleoption.html">QStyleOption</a> subclasses to implement
extensions without breaking compatibility. If you use <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>(), you
normally do not need to check it.</p>
<p><b>See also</b> <a href="qstyleoption.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOption" />QStyleOption.__init__ (<i>self</i>, int&#160;<i>version</i>&#160;=&#160;QStyleOption.Version, int&#160;<i>type</i>&#160;=&#160;QStyleOption.SO_Default)</h3><p>Constructs a <a href="qstyleoption.html">QStyleOption</a> with
the specified <i>version</i> and <i>type</i>.</p>
<p>The version has no special meaning for <a href="qstyleoption.html">QStyleOption</a>; it can be used by subclasses
to distinguish between different version of the same option
type.</p>
<p>The <a href="qstyleoption.html#state-var">state</a> member
variable is initialized to <a href="qstyle.html#StateFlag-enum">QStyle.State_None</a>.</p>
<p><b>See also</b> <a href="qstyleoption.html#version-var">version</a> and <a href="qstyleoption.html#type-varx">type</a>.</p>


<h3 class="fn"><a name="QStyleOption-2" />QStyleOption.__init__ (<i>self</i>, <a href="qstyleoption.html">QStyleOption</a>&#160;<i>other</i>)</h3><p>Constructs a copy of <i>other</i>.</p>


<h3 class="fn"><a name="init" />QStyleOption.init (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>w</i>)</h3><h3 class="fn"><a name="initFrom" />QStyleOption.initFrom (<i>self</i>, <a href="qwidget.html">QWidget</a>&#160;<i>w</i>)</h3><p>Initializes the <a href="qstyleoption.html#state-var">state</a>,
<a href="qstyleoption.html#direction-var">direction</a>, <a href="qstyleoption.html#rect-var">rect</a>, <a href="qstyleoption.html#palette-var">palette</a>, and <a href="qstyleoption.html#fontMetrics-var">fontMetrics</a> member
variables based on the specified <i>widget</i>.</p>
<p>This is a convenience function; the member variables can also be
initialized manually.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also</b> <a href="qwidget.html#layoutDirection-prop">QWidget.layoutDirection</a>(),
<a href="qwidget.html#rect-prop">QWidget.rect</a>(), <a href="qwidget.html#palette-prop">QWidget.palette</a>(), and <a href="qwidget.html#fontMetrics">QWidget.fontMetrics</a>().</p>


<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="direction-var" /><a href="qt.html#LayoutDirection-enum">Qt.LayoutDirection</a> direction</h3><p>This variable holds the text layout direction that should be
used when drawing text in the control.</p>
<p>By default, the layout direction is <a href="qt.html#LayoutDirection-enum">Qt.LeftToRight</a>.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">initFrom</a>().</p>


<h3 class="fn"><a name="fontMetrics-var" /><a href="qfontmetrics.html">QFontMetrics</a> fontMetrics</h3><p>This variable holds the font metrics that should be used when
drawing text in the control.</p>
<p>By default, the application's default font is used.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">initFrom</a>().</p>


<h3 class="fn"><a name="palette-var" /><a href="qpalette.html">QPalette</a> palette</h3><p>This variable holds the palette that should be used when
painting the control.</p>
<p>By default, the application's default palette is used.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">initFrom</a>().</p>


<h3 class="fn"><a name="rect-var" /><a href="qrect.html">QRect</a> rect</h3><p>This variable holds the area that should be used for various
calculations and painting.</p>
<p>This can have different meanings for different types of
elements. For example, for a <a href="qstyle.html#ControlElement-enum">QStyle.CE_PushButton</a> element
it would be the rectangle for the entire button, while for a
<a href="qstyle.html#ControlElement-enum">QStyle.CE_PushButtonLabel</a>
element it would be just the area for the push button label.</p>
<p>The default value is a null rectangle, i.e. a rectangle with
both the width and the height set to 0.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">initFrom</a>().</p>


<h3 class="fn"><a name="state-var" /><a href="qstyle-state.html">QStyle.State</a> state</h3><p>This variable holds the style flags that are used when drawing
the control.</p>
<p>The default value is <a href="qstyle.html#StateFlag-enum">QStyle.State_None</a>.</p>
<p><b>See also</b> <a href="qstyleoption.html#initFrom">initFrom</a>(), <a href="qstyle.html#drawPrimitive">QStyle.drawPrimitive</a>(), <a href="qstyle.html#drawControl">QStyle.drawControl</a>(), <a href="qstyle.html#drawComplexControl">QStyle.drawComplexControl</a>(),
and <a href="qstyle.html#StateFlag-enum">QStyle.State</a>.</p>


<h3 class="fn"><a name="type-var" />int type</h3><h3 class="fn"><a name="version-var" />int version</h3><p>This variable holds the version of the style option.</p>
<p>This value can be used by subclasses to implement extensions
without breaking compatibility. If you use the <a href="qstyleoption.html#qstyleoption_cast">qstyleoption_cast</a>()
function, you normally do not need to check it.</p>
<p>The default value is 1.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;4.10.3 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.5</td></tr></table></div></address></body></html>