<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <!-- /tmp/qt-3.0-reggie-28534/qt-x11-free-3.0.2/src/kernel/qstyle.cpp:55 --> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"> <title>QStyleOption Class</title> <style type="text/css"><!-- h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; } a:link { color: #004faf; text-decoration: none } a:visited { color: #672967; text-decoration: none } body { background: #ffffff; color: black; } --></style> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr bgcolor="#E5E5E5"> <td valign=center> <a href="index.html"> <font color="#004faf">Home</font></a> | <a href="classes.html"> <font color="#004faf">All Classes</font></a> | <a href="mainclasses.html"> <font color="#004faf">Main Classes</font></a> | <a href="annotated.html"> <font color="#004faf">Annotated</font></a> | <a href="groups.html"> <font color="#004faf">Grouped Classes</font></a> | <a href="functions.html"> <font color="#004faf">Functions</font></a> </td> <td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QStyleOption Class Reference</h1> <p>The QStyleOption class specifies optional parameters for QStyle functions. <a href="#details">More...</a> <p><tt>#include <<a href="qstyle-h.html">qstyle.h</a>></tt> <p><a href="qstyleoption-members.html">List of all member functions.</a> <h2>Public Members</h2> <ul> <li><div class=fn>enum <a href="#StyleOptionDefault-enum"><b>StyleOptionDefault</b></a> { Default }</div></li> <li><div class=fn><a href="#QStyleOption"><b>QStyleOption</b></a> ( StyleOptionDefault = Default )</div></li> <li><div class=fn><a href="#QStyleOption-2"><b>QStyleOption</b></a> ( int in1, int in2 )</div></li> <li><div class=fn><a href="#QStyleOption-3"><b>QStyleOption</b></a> ( int in1, int in2, int in3, int in4 )</div></li> <li><div class=fn><a href="#QStyleOption-4"><b>QStyleOption</b></a> ( QMenuItem * m )</div></li> <li><div class=fn><a href="#QStyleOption-5"><b>QStyleOption</b></a> ( QMenuItem * m, int in1 )</div></li> <li><div class=fn><a href="#QStyleOption-6"><b>QStyleOption</b></a> ( QMenuItem * m, int in1, int in2 )</div></li> <li><div class=fn><a href="#QStyleOption-7"><b>QStyleOption</b></a> ( const QColor & c )</div></li> <li><div class=fn><a href="#QStyleOption-8"><b>QStyleOption</b></a> ( QTab * t )</div></li> <li><div class=fn><a href="#QStyleOption-9"><b>QStyleOption</b></a> ( QListViewItem * i )</div></li> <li><div class=fn><a href="#QStyleOption-a"><b>QStyleOption</b></a> ( Qt::ArrowType a )</div></li> <li><div class=fn>bool <a href="#isDefault"><b>isDefault</b></a> () const</div></li> <li><div class=fn>int <a href="#lineWidth"><b>lineWidth</b></a> () const</div></li> <li><div class=fn>int <a href="#midLineWidth"><b>midLineWidth</b></a> () const</div></li> <li><div class=fn>int <a href="#frameShape"><b>frameShape</b></a> () const</div></li> <li><div class=fn>int <a href="#frameShadow"><b>frameShadow</b></a> () const</div></li> <li><div class=fn>QMenuItem * <a href="#menuItem"><b>menuItem</b></a> () const</div></li> <li><div class=fn>int <a href="#maxIconWidth"><b>maxIconWidth</b></a> () const</div></li> <li><div class=fn>int <a href="#tabWidth"><b>tabWidth</b></a> () const</div></li> <li><div class=fn>const QColor & <a href="#color"><b>color</b></a> () const</div></li> <li><div class=fn>QTab * <a href="#tab"><b>tab</b></a> () const</div></li> <li><div class=fn>QListViewItem * <a href="#listViewItem"><b>listViewItem</b></a> () const</div></li> <li><div class=fn>Qt::ArrowType <a href="#arrowType"><b>arrowType</b></a> () const</div></li> </ul> <hr><a name="details"></a><h2>Detailed Description</h2> The QStyleOption class specifies optional parameters for <a href="qstyle.html">QStyle</a> functions. <p> Some QStyle functions take an optional argument specifying extra information that is required for a paritical primitive or control. So that the QStyle class can be extended, QStyleOption is use to give a variable-argument for these options. <p> The QStyleOption class has constructors for each type of optional argument, and this set of constructors may be extended in future Qt releases. There are also corresponding access functions that return the optional arguments - these too may be extended. <p> For each constructor, you should refer to the documentation of the QStyle functions to see the meaning of the arguments. <p> When calling QStyle functions from your own widgets, you must only pass either the default QStyleOption or the argument that QStyle is documented to accept. For example, if the function expects QStyleOption(QMenuItem *, int), passing QStyleOption(QMenuItem *) leaves the optional integer argument uninitialized. <p> When subclassing <a href="qstyle.html">QStyle</a>, you must similarly only expect the default or documented arguments. The other arguments will have uninitialized values. <p> If you make your own QStyle subclasses and your own widgets, you can make a subclass of QStyleOption to pass additional arguments to your QStyle subclass. You will need to cast the "const QStyleOption&" argument to your subclass, so be sure your style has been called from your widget. <p>See also <a href="appearance.html">Widget Appearance and Style</a>. <hr><h2>Member Type Documentation</h2> <h3 class=fn><a name="StyleOptionDefault-enum"></a>QStyleOption::StyleOptionDefault</h3> <p> This enum value can be passed as the optional argument to any <a href="qstyle.html">QStyle</a> function. <ul> <li><tt>QStyleOption::Default</tt> </ul> <hr><h2>Member Function Documentation</h2> <h3 class=fn><a name="QStyleOption"></a>QStyleOption::QStyleOption ( <a href="qstyleoption.html#StyleOptionDefault-enum">StyleOptionDefault</a> = Default ) </h3> <p> The default option. This can always be passed as the optional argument to <a href="qstyle.html">QStyle</a> functions. <h3 class=fn><a name="QStyleOption-2"></a>QStyleOption::QStyleOption ( int in1, int in2 ) </h3> <p> Pass two integers, <em>in1</em> and <em>in2</em>. For example, linewidth and midlinewidth. <h3 class=fn><a name="QStyleOption-3"></a>QStyleOption::QStyleOption ( int in1, int in2, int in3, int in4 ) </h3> <p> Pass four integers, <em>in1</em>, <em>in2</em>, <em>in3</em> and <em>in4</em>. <h3 class=fn><a name="QStyleOption-4"></a>QStyleOption::QStyleOption ( QMenuItem * m ) </h3> <p> Pass a menu item, <em>m</em>. <h3 class=fn><a name="QStyleOption-5"></a>QStyleOption::QStyleOption ( QMenuItem * m, int in1 ) </h3> <p> Pass a menu item and an integer, <em>m</em> and <em>in1</em>. <h3 class=fn><a name="QStyleOption-6"></a>QStyleOption::QStyleOption ( QMenuItem * m, int in1, int in2 ) </h3> <p> Pass a menu item and two integers, <em>m</em>, <em>in1</em> and <em>in2</em>. <h3 class=fn><a name="QStyleOption-7"></a>QStyleOption::QStyleOption ( const <a href="qcolor.html">QColor</a> & c ) </h3> <p> Pass a color, <em>c</em>. <h3 class=fn><a name="QStyleOption-8"></a>QStyleOption::QStyleOption ( <a href="qtab.html">QTab</a> * t ) </h3> <p> Pass a <a href="qtab.html">QTab</a>, <em>t</em>. <h3 class=fn><a name="QStyleOption-9"></a>QStyleOption::QStyleOption ( <a href="qlistviewitem.html">QListViewItem</a> * i ) </h3> <p> Pass a <a href="qlistviewitem.html">QListViewItem</a>, <em>i</em>. <h3 class=fn><a name="QStyleOption-a"></a>QStyleOption::QStyleOption ( <a href="qt.html#ArrowType-enum">Qt::ArrowType</a> a ) </h3> <p> Pass an Qt::ArrowType, <em>a</em>. <h3 class=fn><a href="qt.html#ArrowType-enum">Qt::ArrowType</a> <a name="arrowType"></a>QStyleOption::arrowType () const </h3> <p> Returns an arrow type if the appropriate constructor was called, else undefined. <h3 class=fn>const <a href="qcolor.html">QColor</a> & <a name="color"></a>QStyleOption::color () const </h3> <p> Returns a color if the appropriate constructor was called, else undefined. <h3 class=fn>int <a name="frameShadow"></a>QStyleOption::frameShadow () const </h3> <p> Returns a QFrame::Shadow value if the appropriate constructor was called, else undefined. <h3 class=fn>int <a name="frameShape"></a>QStyleOption::frameShape () const </h3> <p> Returns a QFrame::Shape value if the appropriate constructor was called, else undefined. <h3 class=fn>bool <a name="isDefault"></a>QStyleOption::isDefault () const </h3> <p> Returns whether the option was constructed with the default constructor. <h3 class=fn>int <a name="lineWidth"></a>QStyleOption::lineWidth () const </h3> <p> Returns the line width if the appropriate constructor was called, else undefined. <h3 class=fn><a href="qlistviewitem.html">QListViewItem</a> * <a name="listViewItem"></a>QStyleOption::listViewItem () const </h3> <p> Returns a <a href="qlistview.html">QListView</a> item if the appropriate constructor was called, else undefined. <h3 class=fn>int <a name="maxIconWidth"></a>QStyleOption::maxIconWidth () const </h3> <p> Returns the maximum width of the menu item check area if the appropriate constructor was called, else undefined. <h3 class=fn>QMenuItem * <a name="menuItem"></a>QStyleOption::menuItem () const </h3> <p> Returns a menu item if the appropriate constructor was called, else undefined. <h3 class=fn>int <a name="midLineWidth"></a>QStyleOption::midLineWidth () const </h3> <p> Returns the mid-line width if the appropriate constructor was called, else undefined. <h3 class=fn><a href="qtab.html">QTab</a> * <a name="tab"></a>QStyleOption::tab () const </h3> <p> Returns a <a href="qtabbar.html">QTabBar</a> tab if the appropriate constructor was called, else undefined. <h3 class=fn>int <a name="tabWidth"></a>QStyleOption::tabWidth () const </h3> <p> Returns the tab indent width if the appropriate constructor was called, else undefined. <!-- eof --> <hr><p> This file is part of the <a href="index.html">Qt toolkit</a>. Copyright © 1995-2001 <a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center> <table width=100% cellspacing=0 border=0><tr> <td>Copyright © 2001 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a> <td align=right><div align=right>Qt version 3.0.2</div> </table></div></address></body> </html>