1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164
|
<?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>QStyleOptionToolButton 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">  </td><td class="postheader" 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="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QStyleOptionToolButton Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionToolButton class is used to describe the
parameters for drawing a tool button. <a href="#details">More...</a></p>
<p>Inherits <a href="qstyleoptioncomplex.html">QStyleOptionComplex</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#StyleOptionType-enum">StyleOptionType</a></b> { Type }</li><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#StyleOptionVersion-enum">StyleOptionVersion</a></b> { Version }</li><li><div class="fn" />enum <b><a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">ToolButtonFeature</a></b> { None, Arrow, Menu, PopupDelay, MenuButtonPopup, HasMenu }</li><li><div class="fn" />class <b><a href="qstyleoptiontoolbutton-toolbuttonfeatures.html">ToolButtonFeatures</a></b></li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptiontoolbutton.html#QStyleOptionToolButton">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptiontoolbutton.html#QStyleOptionToolButton-2">__init__</a></b> (<i>self</i>, QStyleOptionToolButton <i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />Qt.ArrowType <b><a href="qstyleoptiontoolbutton.html#arrowType-var">arrowType</a></b></li><li><div class="fn" />ToolButtonFeatures <b><a href="qstyleoptiontoolbutton.html#features-var">features</a></b></li><li><div class="fn" />QFont <b><a href="qstyleoptiontoolbutton.html#font-var">font</a></b></li><li><div class="fn" />QIcon <b><a href="qstyleoptiontoolbutton.html#icon-var">icon</a></b></li><li><div class="fn" />QSize <b><a href="qstyleoptiontoolbutton.html#iconSize-var">iconSize</a></b></li><li><div class="fn" />QPoint <b><a href="qstyleoptiontoolbutton.html#pos-var">pos</a></b></li><li><div class="fn" />QString <b><a href="qstyleoptiontoolbutton.html#text-var">text</a></b></li><li><div class="fn" />Qt.ToolButtonStyle <b><a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionToolButton class is used to describe the
parameters for drawing a tool button.</p>
<p>QStyleOptionToolButton contains all the information that
<a href="qstyle.html">QStyle</a> functions need to draw <a href="qtoolbutton.html">QToolButton</a>.</p>
<p>For performance reasons, the access to the member variables is
direct (i.e., using the <tt>.</tt> or <tt>-></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>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="StyleOptionType-enum" />QStyleOptionToolButton.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>QStyleOptionToolButton.Type</tt></td>
<td class="topAlign"><tt>SO_ToolButton</tt></td>
<td class="topAlign">The type of style option provided (<a href="qstyleoption.html#OptionType-enum">SO_ToolButton</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="qstyleoptiontoolbutton.html#StyleOptionVersion-enum">StyleOptionVersion</a>.</p>
<h3 class="fn"><a name="StyleOptionVersion-enum" />QStyleOptionToolButton.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>QStyleOptionToolButton.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="qstyleoptiontoolbutton.html#StyleOptionType-enum">StyleOptionType</a>.</p>
<h3 class="fn"><a name="ToolButtonFeature-enum" />QStyleOptionToolButton.ToolButtonFeature</h3><p>Describes the various features that a tool button can have.</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>QStyleOptionToolButton.None</tt></td>
<td class="topAlign"><tt>0x00</tt></td>
<td class="topAlign">A normal tool button.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Arrow</tt></td>
<td class="topAlign"><tt>0x01</tt></td>
<td class="topAlign">The tool button is an arrow.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.Menu</tt></td>
<td class="topAlign"><tt>0x04</tt></td>
<td class="topAlign">The tool button has a menu.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionToolButton.PopupDelay</tt></td>
<td class="topAlign"><tt>0x08</tt></td>
<td class="topAlign">There is a delay to showing the menu.</td>
</tr>
<tr>
<td class="topAlign"><tt>QStyleOptionToolButton.HasMenu</tt></td>
<td class="topAlign"><tt>0x10</tt></td>
<td class="topAlign">The button has a popup menu.</td>
</tr>
<tr>
<td class="topAlign">
<tt>QStyleOptionToolButton.MenuButtonPopup</tt></td>
<td class="topAlign"><tt>Menu</tt></td>
<td class="topAlign">The button should display an arrow to indicate
that a menu is present.</td>
</tr>
</table>
<p>The ToolButtonFeatures type is a typedef for <a href="qflags.html">QFlags</a><ToolButtonFeature>. It stores an OR
combination of ToolButtonFeature values.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#features-var">features</a>, <a href="qtoolbutton.html#toolButtonStyle-prop">QToolButton.toolButtonStyle</a>(),
and <a href="qtoolbutton.html#popupMode-prop">QToolButton.popupMode</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionToolButton" />QStyleOptionToolButton.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a>,
initializing the members variables to their default values.</p>
<h3 class="fn"><a name="QStyleOptionToolButton-2" />QStyleOptionToolButton.__init__ (<i>self</i>, <a href="qstyleoptiontoolbutton.html">QStyleOptionToolButton</a> <i>other</i>)</h3><p>Constructs a copy of the <i>other</i> style option.</p>
<hr /><h2>Member Documentation</h2><h3 class="fn"><a name="arrowType-var" /><a href="qt.html#ArrowType-enum">Qt.ArrowType</a> arrowType</h3><p>This variable holds the direction of the arrow for the tool
button.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#features-var">features</a> includes
<a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">Arrow</a>. The
default value is <a href="qt.html#ArrowType-enum">Qt.DownArrow</a>.</p>
<h3 class="fn"><a name="features-var" /><a href="qstyleoptiontoolbutton-toolbuttonfeatures.html">ToolButtonFeatures</a> features</h3><p>This variable holds an OR combination of the tool button's
features.</p>
<p>The default value is <a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">None</a>.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#ToolButtonFeature-enum">ToolButtonFeature</a>.</p>
<h3 class="fn"><a name="font-var" /><a href="qfont.html">QFont</a> font</h3><p>This variable holds the font that is used for the text.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a>
is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextUnderIcon</a>,
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextBesideIcon</a>, or
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextOnly</a>.
By default, the application's default font is used.</p>
<h3 class="fn"><a name="icon-var" /><a href="qicon.html">QIcon</a> icon</h3><p>This variable holds the icon for the tool button.</p>
<p>The default value is an empty icon, i.e. an icon with neither a
pixmap nor a filename.</p>
<p><b>See also</b> <a href="qstyleoptiontoolbutton.html#iconSize-var">iconSize</a>.</p>
<h3 class="fn"><a name="iconSize-var" /><a href="qsize.html">QSize</a> iconSize</h3><p>This variable holds the size of the icon for the tool
button.</p>
<p>The default value is <a href="qsize.html">QSize</a>(-1, -1),
i.e. an invalid size.</p>
<h3 class="fn"><a name="pos-var" /><a href="qpoint.html">QPoint</a> pos</h3><p>This variable holds the position of the tool button.</p>
<p>The default value is a null point, i.e. (0, 0)</p>
<h3 class="fn"><a name="text-var" />QString text</h3><p>This variable holds the text of the tool button.</p>
<p>This value is only used if <a href="qstyleoptiontoolbutton.html#toolButtonStyle-var">toolButtonStyle</a>
is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextUnderIcon</a>,
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextBesideIcon</a>, or
<a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonTextOnly</a>.
The default value is an empty string.</p>
<h3 class="fn"><a name="toolButtonStyle-var" /><a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonStyle</a> toolButtonStyle</h3><p>This variable holds a Qt.ToolButtonStyle value describing the
appearance of the tool button.</p>
<p>The default value is <a href="qt.html#ToolButtonStyle-enum">Qt.ToolButtonIconOnly</a>.</p>
<p><b>See also</b> <a href="qtoolbutton.html#toolButtonStyle-prop">QToolButton.toolButtonStyle</a>().</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt 4.9.3 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt 4.8.2</td></tr></table></div></address></body></html>
|