~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/qstyleoptionmenuitem.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/src/gui/styles/qstyleoption.cpp -->
 
6
<head>
 
7
    <title>Qt 4.0: QStyleOptionMenuItem Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">QStyleOptionMenuItem Class Reference</h1>
 
21
<p>The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;QStyleOptionMenuItem&gt;</pre><p>Part of the <a href="qtgui.html">QtGui</a> module.</p>
 
23
<p>Inherits <a href="qstyleoption.html">QStyleOption</a>.</p>
 
24
<ul>
 
25
<li><a href="qstyleoptionmenuitem-members.html">List of all members, including inherited members</a></li>
 
26
</ul>
 
27
<a name="public-types"></a>
 
28
<h3>Public Types</h3>
 
29
<ul>
 
30
<li><div class="fn"/>enum <b><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a></b> { NotCheckable, Exclusive, NonExclusive }</li>
 
31
<li><div class="fn"/>enum <b><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a></b> { Normal, DefaultItem, Separator, SubMenu, ..., EmptyArea }</li>
 
32
</ul>
 
33
<a name="public-functions"></a>
 
34
<h3>Public Functions</h3>
 
35
<ul>
 
36
<li><div class="fn"/><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem">QStyleOptionMenuItem</a></b> ()</li>
 
37
<li><div class="fn"/><b><a href="qstyleoptionmenuitem.html#QStyleOptionMenuItem-2">QStyleOptionMenuItem</a></b> ( const QStyleOptionMenuItem &amp; <i>other</i> )</li>
 
38
</ul>
 
39
<ul>
 
40
<li><div class="fn"/>2 public functions inherited from <a href="qstyleoption.html#public-functions">QStyleOption</a></li>
 
41
</ul>
 
42
<a name="public-variables"></a>
 
43
<h3>Public Variables</h3>
 
44
<ul>
 
45
<li><div class="fn"/>CheckType <b><a href="qstyleoptionmenuitem.html#checkType-var">checkType</a></b></li>
 
46
<li><div class="fn"/>bool <b><a href="qstyleoptionmenuitem.html#checked-var">checked</a></b></li>
 
47
<li><div class="fn"/>QFont <b><a href="qstyleoptionmenuitem.html#font-var">font</a></b></li>
 
48
<li><div class="fn"/>QIcon <b><a href="qstyleoptionmenuitem.html#icon-var">icon</a></b></li>
 
49
<li><div class="fn"/>int <b><a href="qstyleoptionmenuitem.html#maxIconWidth-var">maxIconWidth</a></b></li>
 
50
<li><div class="fn"/>bool <b><a href="qstyleoptionmenuitem.html#menuHasCheckableItems-var">menuHasCheckableItems</a></b></li>
 
51
<li><div class="fn"/>MenuItemType <b><a href="qstyleoptionmenuitem.html#menuItemType-var">menuItemType</a></b></li>
 
52
<li><div class="fn"/>QRect <b><a href="qstyleoptionmenuitem.html#menuRect-var">menuRect</a></b></li>
 
53
<li><div class="fn"/>int <b><a href="qstyleoptionmenuitem.html#tabWidth-var">tabWidth</a></b></li>
 
54
<li><div class="fn"/>QString <b><a href="qstyleoptionmenuitem.html#text-var">text</a></b></li>
 
55
</ul>
 
56
<ul>
 
57
<li><div class="fn"/>7 public variables inherited from <a href="qstyleoption.html#public-variables">QStyleOption</a></li>
 
58
</ul>
 
59
<a name="static-public-members"></a>
 
60
<h3>Static Public Members</h3>
 
61
<ul>
 
62
<li><div class="fn"/>const int <b><a href="qstyleoptionmenuitem.html#Type-var">Type</a></b></li>
 
63
<li><div class="fn"/>const int <b><a href="qstyleoptionmenuitem.html#Version-var">Version</a></b></li>
 
64
</ul>
 
65
<ul>
 
66
<li><div class="fn"/>2 static public members inherited from <a href="qstyleoption.html#static-public-members">QStyleOption</a></li>
 
67
</ul>
 
68
<a name="details"></a>
 
69
<hr />
 
70
<h2>Detailed Description</h2>
 
71
<p>The QStyleOptionMenuItem class is used to describe the parameter necessary for drawing a menu item.</p>
 
72
<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>
 
73
<hr />
 
74
<h2>Member Type Documentation</h2>
 
75
<h3 class="fn"><a name="CheckType-enum"></a>enum QStyleOptionMenuItem::CheckType</h3>
 
76
<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>
 
77
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
78
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
79
<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>
 
80
<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>
 
81
<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>
 
82
</table>
 
83
<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>
 
84
<h3 class="fn"><a name="MenuItemType-enum"></a>enum QStyleOptionMenuItem::MenuItemType</h3>
 
85
<p>These values indicate the type of menu item that the structure describes.</p>
 
86
<table border="1" cellpadding="2" cellspacing="1" width="100%">
 
87
<tr><th width="25%">Constant</th><th width="15%">Value</th><th width="60%">Description</th></tr>
 
88
<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>
 
89
<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>
 
90
<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>
 
91
<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>
 
92
<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>
 
93
<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>
 
94
<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>
 
95
<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>
 
96
</table>
 
97
<hr />
 
98
<h2>Member Function Documentation</h2>
 
99
<h3 class="fn"><a name="QStyleOptionMenuItem"></a>QStyleOptionMenuItem::QStyleOptionMenuItem ()</h3>
 
100
<p>Constructs a <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a>. The members variables are initialized to default values.</p>
 
101
<h3 class="fn"><a name="QStyleOptionMenuItem-2"></a>QStyleOptionMenuItem::QStyleOptionMenuItem ( const QStyleOptionMenuItem &amp; <i>other</i> )</h3>
 
102
<p>Constructs a copy of the <i>other</i> style option.</p>
 
103
<hr />
 
104
<h2>Member Variable Documentation</h2>
 
105
<h3 class="fn"><a name="Type-var"></a>const int QStyleOptionMenuItem::Type</h3>
 
106
<p>Equals <a href="qstyleoption.html#OptionType-enum">SO_MenuItem</a>.</p>
 
107
<h3 class="fn"><a name="Version-var"></a>const int QStyleOptionMenuItem::Version</h3>
 
108
<p>Equals 1.</p>
 
109
<h3 class="fn"><a name="checkType-var"></a><a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a> QStyleOptionMenuItem::checkType</h3>
 
110
<p>This variable holds the type of checkmark of the menu item.</p>
 
111
<p>See also <a href="qstyleoptionmenuitem.html#CheckType-enum">CheckType</a>.</p>
 
112
<h3 class="fn"><a name="checked-var"></a>bool QStyleOptionMenuItem::checked</h3>
 
113
<p>This variable holds whether the menu item is checked or not.</p>
 
114
<h3 class="fn"><a name="font-var"></a><a href="qfont.html">QFont</a> QStyleOptionMenuItem::font</h3>
 
115
<p>This variable holds the font used for the menu item text.</p>
 
116
<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>
 
117
<h3 class="fn"><a name="icon-var"></a><a href="qicon.html">QIcon</a> QStyleOptionMenuItem::icon</h3>
 
118
<p>This variable holds the icon for the menu item.</p>
 
119
<h3 class="fn"><a name="maxIconWidth-var"></a>int QStyleOptionMenuItem::maxIconWidth</h3>
 
120
<p>This variable holds the maximum icon width for the icon in the menu item.</p>
 
121
<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>
 
122
<h3 class="fn"><a name="menuHasCheckableItems-var"></a>bool QStyleOptionMenuItem::menuHasCheckableItems</h3>
 
123
<p>This variable holds whether the menu as a whole has checkable items or not.</p>
 
124
<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>
 
125
<h3 class="fn"><a name="menuItemType-var"></a><a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a> QStyleOptionMenuItem::menuItemType</h3>
 
126
<p>This variable holds the type of menu item.</p>
 
127
<p>See also <a href="qstyleoptionmenuitem.html#MenuItemType-enum">MenuItemType</a>.</p>
 
128
<h3 class="fn"><a name="menuRect-var"></a><a href="qrect.html">QRect</a> QStyleOptionMenuItem::menuRect</h3>
 
129
<p>This variable holds the rectangle for the entire menu.</p>
 
130
<h3 class="fn"><a name="tabWidth-var"></a>int QStyleOptionMenuItem::tabWidth</h3>
 
131
<p>This variable holds the tab width for the menu item.</p>
 
132
<p>The tab width is the distance between the text of the menu item and the shortcut.</p>
 
133
<h3 class="fn"><a name="text-var"></a><a href="qstring.html">QString</a> QStyleOptionMenuItem::text</h3>
 
134
<p>This variable holds the text for the menu item.</p>
 
135
<p>Note that the text format is something like this &quot;Menu text<b>\t</b>Shortcut&quot;.</p>
 
136
<p>If the menu item doesn't have a shortcut, it will just contain the menu item's text.</p>
 
137
<p /><address><hr /><div align="center">
 
138
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
139
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
140
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
141
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
142
</tr></table></div></address></body>
 
143
</html>