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
|
<?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>QStyleOptionMenuItem 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="../pyqt4ref.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">QStyleOptionMenuItem Class Reference<br /><sup><sup>[<a href="qtgui.html">QtGui</a> module]</sup></sup></h1><p>The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. <a href="#details">More...</a></p>
<p>Inherits <a href="qstyleoption.html">QStyleOption</a>.</p><h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a></b> { NotCheckable, Exclusive, NonExclusive }</li><li><div class="fn" />enum <b><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a></b> { Normal, DefaultItem, Separator, SubMenu, ..., EmptyArea }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem-2">__init__</a></b> (<i>self</i>, QStyleOptionMenuItem <i>other</i>)</li></ul><h3>Members</h3><ul><li><div class="fn" />bool <b><a href="qstyleoptionmenuitem.html#checked-var">checked</a></b></li><li><div class="fn" />CheckType <b><a href="qstyleoptionmenuitem.html#checkType-var">checkType</a></b></li><li><div class="fn" />QFont <b><a href="qstyleoptionmenuitem.html#font-var">font</a></b></li><li><div class="fn" />QIcon <b><a href="qstyleoptionmenuitem.html#icon-var">icon</a></b></li><li><div class="fn" />int <b><a href="qstyleoptionmenuitem.html#maxIconWidth-var">maxIconWidth</a></b></li><li><div class="fn" />bool <b><a href="qstyleoptionmenuitem.html#menuHasCheckableItems-var">menuHasCheckableItems</a></b></li><li><div class="fn" />MenuItemType <b><a href="qstyleoptionmenuitem.html#menuItemType-var">menuItemType</a></b></li><li><div class="fn" />QRect <b><a href="qstyleoptionmenuitem.html#menuRect-var">menuRect</a></b></li><li><div class="fn" />int <b><a href="qstyleoptionmenuitem.html#tabWidth-var">tabWidth</a></b></li><li><div class="fn" />QString <b><a href="qstyleoptionmenuitem.html#text-var">text</a></b></li></ul><h3>Static Members</h3><ul><li><div class="fn" />int <b><a href="qstyleoptionmenuitem.html#Type-var">Type</a></b></li><li><div class="fn" />int <b><a href="qstyleoptionmenuitem.html#Version-var">Version</a></b></li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item.</p>
<p>The QStyleOptionMenuItem is used for drawing menu items from <a href="qmenu.html">QMenu</a>. It is also used for drawing other menu-related widgets.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="CheckType-enum" />QStyleOptionMenuItem.CheckType</h3><p>These enums are used to indicate whether or not a check mark should be drawn for the item, or even if it should be drawn at all.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.NotCheckable</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">The item is not checkable.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.Exclusive</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">The item is an exclusive check item (like a radio button).</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.NonExclusive</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
<td valign="top">The item is a non-exclusive check item (like a check box).</td>
</tr>
</table>
<br />
<br />
<p>See also <a href="qaction.html#checkable-prop">QAction.checkable</a>, <a href="qaction.html#checked-prop">QAction.checked</a>, and <a href="qactiongroup.html#exclusive-prop">QActionGroup.exclusive</a>.</p>
<h3 class="fn"><a name="MenuItemType-enum" />QStyleOptionMenuItem.MenuItemType</h3><p>These values indicate the type of menu item that the structure describes.</p>
<table border="1" cellpadding="2" cellspacing="1" width="100%">
<tr>
<th width="25%">Constant</th>
<th width="15%">Value</th>
<th width="60%">Description</th>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.Normal</tt></td>
<td align="center" valign="top"><tt>0</tt></td>
<td valign="top">A normal menu item.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.DefaultItem</tt></td>
<td align="center" valign="top"><tt>1</tt></td>
<td valign="top">A menu item that is the default action as specified with <a href="qmenu.html#defaultAction">QMenu.defaultAction</a>().</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.Separator</tt></td>
<td align="center" valign="top"><tt>2</tt></td>
<td valign="top">A menu separator.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.SubMenu</tt></td>
<td align="center" valign="top"><tt>3</tt></td>
<td valign="top">Indicates the menu item points to a sub-menu.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.Scroller</tt></td>
<td align="center" valign="top"><tt>4</tt></td>
<td valign="top">A popup menu scroller (currently only used on Mac OS X).</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.TearOff</tt></td>
<td align="center" valign="top"><tt>5</tt></td>
<td valign="top">A tear-off handle for the menu.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.Margin</tt></td>
<td align="center" valign="top"><tt>6</tt></td>
<td valign="top">The margin of the menu.</td>
</tr>
<tr>
<td valign="top"><tt>QStyleOptionMenuItem.EmptyArea</tt></td>
<td align="center" valign="top"><tt>7</tt></td>
<td valign="top">The empty area of the menu.</td>
</tr>
</table>
<br />
<br />
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QStyleOptionMenuItem" />QStyleOptionMenuItem.__init__ (<i>self</i>)</h3><p>Constructs a <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a>. The members variables are initialized to default values.</p>
<h3 class="fn"><a name="QStyleOptionMenuItem-2" />QStyleOptionMenuItem.__init__ (<i>self</i>, <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</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="checked-var" />bool checked</h3><p>This variable holds whether the menu item is checked or not.</p>
<h3 class="fn"><a name="checkType-var" /><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a> checkType</h3><p>This variable holds the type of checkmark of the menu item.</p>
<p>See also <a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a>.</p>
<h3 class="fn"><a name="font-var" /><a href="qfont.html">QFont</a> font</h3><p>This variable holds the font used for the menu item text.</p>
<p>This is the font that should be used for drawing the menu text minus the shortcut. The shortcut is usually drawn using the painter's font.</p>
<h3 class="fn"><a name="icon-var" /><a href="qicon.html">QIcon</a> icon</h3><p>This variable holds the icon for the menu item.</p>
<h3 class="fn"><a name="maxIconWidth-var" />int maxIconWidth</h3><p>This variable holds the maximum icon width for the icon in the menu item.</p>
<p>This can be used for drawing the icon into the correct place or properly aligning items. The variable must be set regardless of whether or not the menu item has an icon.</p>
<h3 class="fn"><a name="menuHasCheckableItems-var" />bool menuHasCheckableItems</h3><p>This variable holds whether the menu as a whole has checkable items or not.</p>
<p>If this option is set to false, then the menu has no checkable items. This makes it possible for GUI styles to save some horizontal space that would normally be used for the check column.</p>
<h3 class="fn"><a name="menuItemType-var" /><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a> menuItemType</h3><p>This variable holds the type of menu item.</p>
<p>See also <a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a>.</p>
<h3 class="fn"><a name="menuRect-var" /><a href="qrect.html">QRect</a> menuRect</h3><p>This variable holds the rectangle for the entire menu.</p>
<h3 class="fn"><a name="tabWidth-var" />int tabWidth</h3><p>This variable holds the tab width for the menu item.</p>
<p>The tab width is the distance between the text of the menu item and the shortcut.</p>
<h3 class="fn"><a name="text-var" /><a href="qstring.html">QString</a> text</h3><p>This variable holds the text for the menu item.</p>
<p>Note that the text format is something like this "Menu text<b>\t</b>Shortcut".</p>
<p>If the menu item doesn't have a shortcut, it will just contain the menu item's text.</p>
<h3 class="fn"><a name="Type-var" />int Type</h3><p>This member should be treated as a constant.</p><p>Equals <a href="qstyleoption.html#OptionType-enum">SO_MenuItem</a>.</p>
<h3 class="fn"><a name="Version-var" />int Version</h3><p>This member should be treated as a constant.</p><p>Equals 1.</p>
<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td width="25%">PyQt 4.0.1 for X11</td><td align="center" width="50%">Copyright © <a href="http://www.riverbankcomputing.com">Riverbank Computing Ltd</a> and <a href="http://www.trolltech.com">Trolltech AS</a> 2006</td><td align="right" width="25%">Qt 4.1.4</td></tr></table></div></address></body></html>
|