source: trunk/doc/html/qmenubar.html

Last change on this file was 190, checked in by rudi, 14 years ago

reference documentation added

File size: 43.9 KB
Line 
1<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
2<!-- /home/espenr/tmp/qt-3.3.8-espenr-2499/qt-x11-free-3.3.8/src/widgets/qmenubar.cpp:75 -->
3<html>
4<head>
5<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
6<title>QMenuBar Class</title>
7<style type="text/css"><!--
8fn { margin-left: 1cm; text-indent: -1cm; }
9a:link { color: #004faf; text-decoration: none }
10a:visited { color: #672967; text-decoration: none }
11body { background: #ffffff; color: black; }
12--></style>
13</head>
14<body>
15
16<table border="0" cellpadding="0" cellspacing="0" width="100%">
17<tr bgcolor="#E5E5E5">
18<td valign=center>
19 <a href="index.html">
20<font color="#004faf">Home</font></a>
21 | <a href="classes.html">
22<font color="#004faf">All&nbsp;Classes</font></a>
23 | <a href="mainclasses.html">
24<font color="#004faf">Main&nbsp;Classes</font></a>
25 | <a href="annotated.html">
26<font color="#004faf">Annotated</font></a>
27 | <a href="groups.html">
28<font color="#004faf">Grouped&nbsp;Classes</font></a>
29 | <a href="functions.html">
30<font color="#004faf">Functions</font></a>
31</td>
32<td align="right" valign="center"><img src="logo32.png" align="right" width="64" height="32" border="0"></td></tr></table><h1 align=center>QMenuBar Class Reference</h1>
33
34<p>The QMenuBar class provides a horizontal menu bar.
35<a href="#details">More...</a>
36<p><tt>#include &lt;<a href="qmenubar-h.html">qmenubar.h</a>&gt;</tt>
37<p>Inherits <a href="qframe.html">QFrame</a> and <a href="qmenudata.html">QMenuData</a>.
38<p><a href="qmenubar-members.html">List of all member functions.</a>
39<h2>Public Members</h2>
40<ul>
41<li class=fn><a href="#QMenuBar"><b>QMenuBar</b></a> ( QWidget&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )</li>
42<li class=fn><a href="#~QMenuBar"><b>~QMenuBar</b></a> ()</li>
43<li class=fn>virtual void <a href="#show"><b>show</b></a> ()</li>
44<li class=fn>virtual void <a href="#hide"><b>hide</b></a> ()</li>
45<li class=fn>virtual int <a href="#heightForWidth"><b>heightForWidth</b></a> ( int&nbsp;max_width ) const</li>
46<li class=fn>enum <a href="#Separator-enum"><b>Separator</b></a> { Never = 0, InWindowsStyle = 1 }</li>
47<li class=fn>Separator separator () const &nbsp;<em>(obsolete)</em></li>
48<li class=fn>virtual void setSeparator ( Separator&nbsp;when ) &nbsp;<em>(obsolete)</em></li>
49<li class=fn>void <a href="#setDefaultUp"><b>setDefaultUp</b></a> ( bool )</li>
50<li class=fn>bool <a href="#isDefaultUp"><b>isDefaultUp</b></a> () const</li>
51</ul>
52<h2>Signals</h2>
53<ul>
54<li class=fn>void <a href="#activated"><b>activated</b></a> ( int&nbsp;id )</li>
55<li class=fn>void <a href="#highlighted"><b>highlighted</b></a> ( int&nbsp;id )</li>
56</ul>
57<h2>Important Inherited Members</h2>
58<ul>
59<li class=fn>int <a href="#insertItem"><b>insertItem</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, const&nbsp;QObject&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;QKeySequence&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
60<li class=fn>int <a href="#insertItem-2"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QString&nbsp;&amp;&nbsp;text, const&nbsp;QObject&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;QKeySequence&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
61<li class=fn>int <a href="#insertItem-3"><b>insertItem</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, const&nbsp;QObject&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;QKeySequence&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
62<li class=fn>int <a href="#insertItem-4"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, const&nbsp;QObject&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;QKeySequence&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
63<li class=fn>int <a href="#insertItem-5"><b>insertItem</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
64<li class=fn>int <a href="#insertItem-6"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QString&nbsp;&amp;&nbsp;text, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
65<li class=fn>int <a href="#insertItem-7"><b>insertItem</b></a> ( const&nbsp;QString&nbsp;&amp;&nbsp;text, QPopupMenu&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
66<li class=fn>int <a href="#insertItem-8"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QString&nbsp;&amp;&nbsp;text, QPopupMenu&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
67<li class=fn>int <a href="#insertItem-9"><b>insertItem</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
68<li class=fn>int <a href="#insertItem-a"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
69<li class=fn>int <a href="#insertItem-b"><b>insertItem</b></a> ( const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, QPopupMenu&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
70<li class=fn>int <a href="#insertItem-c"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, const&nbsp;QPixmap&nbsp;&amp;&nbsp;pixmap, QPopupMenu&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
71<li class=fn>int <a href="#insertItem-d"><b>insertItem</b></a> ( QWidget&nbsp;*&nbsp;widget, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
72<li class=fn>int <a href="#insertItem-e"><b>insertItem</b></a> ( const&nbsp;QIconSet&nbsp;&amp;&nbsp;icon, QCustomMenuItem&nbsp;*&nbsp;custom, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
73<li class=fn>int <a href="#insertItem-f"><b>insertItem</b></a> ( QCustomMenuItem&nbsp;*&nbsp;custom, int&nbsp;id = -1, int&nbsp;index = -1 )</li>
74<li class=fn>int <a href="#insertSeparator"><b>insertSeparator</b></a> ( int&nbsp;index = -1 )</li>
75<li class=fn>void <a href="#removeItem"><b>removeItem</b></a> ( int&nbsp;id )</li>
76<li class=fn>void <a href="#clear"><b>clear</b></a> ()</li>
77<li class=fn>bool <a href="#isItemEnabled"><b>isItemEnabled</b></a> ( int&nbsp;id ) const</li>
78<li class=fn>void <a href="#setItemEnabled"><b>setItemEnabled</b></a> ( int&nbsp;id, bool&nbsp;enable )</li>
79<li class=fn>bool <a href="#isItemVisible"><b>isItemVisible</b></a> ( int&nbsp;id ) const</li>
80<li class=fn>void <a href="#setItemVisible"><b>setItemVisible</b></a> ( int&nbsp;id, bool&nbsp;visible )</li>
81</ul>
82<h2>Properties</h2>
83<ul>
84<li class=fn>bool <a href="#defaultUp-prop"><b>defaultUp</b></a>&nbsp;- the popup orientation</li>
85<li class=fn>Separator separator&nbsp;- in which cases a menubar sparator is drawn &nbsp;<em>(obsolete)</em></li>
86</ul>
87<h2>Protected Members</h2>
88<ul>
89<li class=fn>virtual void <a href="#drawContents"><b>drawContents</b></a> ( QPainter&nbsp;*&nbsp;p )</li>
90<li class=fn>virtual void <a href="#menuContentsChanged"><b>menuContentsChanged</b></a> ()</li>
91<li class=fn>virtual void <a href="#menuStateChanged"><b>menuStateChanged</b></a> ()</li>
92</ul>
93<hr><a name="details"></a><h2>Detailed Description</h2>
94
95
96The QMenuBar class provides a horizontal menu bar.
97<p>
98
99<p> A menu bar consists of a list of pull-down menu items. You add
100menu items with <a href="qmenudata.html#insertItem">insertItem()</a>. For example, asuming that <tt>menubar</tt> is a
101pointer to a QMenuBar and <tt>filemenu</tt> is a pointer to a
102<a href="qpopupmenu.html">QPopupMenu</a>, the following statement inserts the menu into the menu
103bar:
104<pre>
105 menubar-&gt;insertItem( "&amp;File", filemenu );
106 </pre>
107
108The ampersand in the menu item's text sets Alt+F as a shortcut for
109this menu. (You can use "&amp;&amp;" to get a real ampersand in the menu
110bar.)
111<p> Items are either enabled or disabled. You toggle their state with
112<a href="qmenudata.html#setItemEnabled">setItemEnabled</a>().
113<p> There is no need to lay out a menu bar. It automatically sets its
114own geometry to the top of the parent widget and changes it
115appropriately whenever the parent is resized.
116<p>
117<p> Example of creating a menu bar with menu items (from <a href="menu-example.html">menu/menu.cpp</a>):
118
119
120<pre> <a href="qpopupmenu.html">QPopupMenu</a> *file = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
121</pre><pre> file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( p1, "&amp;Open", this, SLOT(open()), CTRL+Key_O );
122 file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( p2, "&amp;New", this, SLOT(news()), CTRL+Key_N );
123</pre><pre> menu = new QMenuBar( this );
124</pre><pre> menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;File", file );
125</pre>
126<p> In most main window style applications you would use the menuBar()
127provided in <a href="qmainwindow.html">QMainWindow</a>, adding <a href="qpopupmenu.html">QPopupMenu</a>s to the menu bar
128and adding <a href="qaction.html">QAction</a>s to the popup menus.
129<p> Example (from <a href="qaction-application-example.html">action/application.cpp</a>):
130
131
132<pre> <a href="qpopupmenu.html">QPopupMenu</a> * file = new <a href="qpopupmenu.html">QPopupMenu</a>( this );
133 <a href="qmainwindow.html#menuBar">menuBar</a>()-&gt;insertItem( "&amp;File", file );
134 fileNewAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
135</pre>
136<p> Menu items can have text and pixmaps (or iconsets), see the
137various <a href="qmenudata.html#insertItem">insertItem()</a>
138overloads, as well as separators, see <a href="qmenudata.html#insertSeparator">insertSeparator()</a>. You can
139also add custom menu items that are derived from
140<a href="qcustommenuitem.html">QCustomMenuItem</a>.
141<p> Menu items may be removed with <a href="qmenudata.html#removeItem">removeItem</a>() and enabled or
142disabled with <a href="qmenudata.html#setItemEnabled">setItemEnabled()</a>.
143<p> <img src=qmenubar-m.png> <img src=qmenubar-w.png>
144<p> <h3> QMenuBar on Qt/Mac
145</h3>
146<a name="1"></a><p> QMenuBar on Qt/Mac is a wrapper for using the system-wide menubar.
147If you have multiple menubars in one dialog the outermost menubar
148(normally inside a widget with <a href="qt.html#WidgetFlags">widget flag</a> <a href="qt.html#WidgetFlags-enum">WType_TopLevel</a>) will
149be used for the system-wide menubar.
150<p> Note that arbitrary Qt widgets <em>cannot</em> be inserted into a
151QMenuBar on the Mac because Qt uses Mac's native menus which don't
152support this functionality. This limitation does not apply to
153stand-alone QPopupMenus.
154<p> Qt/Mac also provides a menubar merging feature to make QMenuBar
155conform more closely to accepted Mac OS X menubar layout. The
156merging functionality is based on string matching the title of a
157<a href="qpopupmenu.html">QPopupMenu</a> entry. These strings are translated (using
158<a href="qobject.html#tr">QObject::tr</a>()) in the "QMenuBar" context. If an entry is moved its
159slots will still fire as if it was in the original place. The
160table below outlines the strings looked for and where the entry is
161placed if matched:
162<p> <center><table cellpadding="4" cellspacing="2" border="0">
163<tr bgcolor="#a2c511"> <th valign="top">String matches <th valign="top">Placement <th valign="top">Notes
164<tr bgcolor="#f0f0f0"> <td valign="top">about.*
165<td valign="top">Application Menu | About <application name>
166<td valign="top">If this entry is not found no About item will appear in
167the Application Menu
168<tr bgcolor="#d0d0d0"> <td valign="top">config, options, setup, settings or preferences
169<td valign="top">Application Menu | Preferences
170<td valign="top">If this entry is not found the Settings item will be disabled
171<tr bgcolor="#f0f0f0"> <td valign="top">quit or exit
172<td valign="top">Application Menu | Quit <application name>
173<td valign="top">If this entry is not found a default Quit item will be
174created to call <a href="qapplication.html#quit">QApplication::quit</a>()
175</table></center>
176<p> <a href="menu-example.html">menu/menu.cpp</a> is an example of
177QMenuBar and <a href="qpopupmenu.html">QPopupMenu</a> use.
178<p> <p>See also <a href="qpopupmenu.html">QPopupMenu</a>, <a href="qaccel.html">QAccel</a>, <a href="qaction.html">QAction</a>, <a href="http://developer.apple.com/techpubs/macosx/Carbon/HumanInterfaceToolbox/Aqua/aqua.html">Aqua Style Guidelines</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Menu Bar</a>, and <a href="application.html">Main Window and Related Classes</a>.
179
180<hr><h2>Member Type Documentation</h2>
181<h3 class=fn><a name="Separator-enum"></a>QMenuBar::Separator</h3>
182
183<p> This enum type is used to decide whether QMenuBar should draw a
184separator line at its bottom.
185<ul>
186<li><tt>QMenuBar::Never</tt> - In many applications there is already a separator,
187and having two looks wrong.
188<li><tt>QMenuBar::InWindowsStyle</tt> - In some other applications a separator looks
189good in Windows style, but nowhere else.
190</ul>
191<hr><h2>Member Function Documentation</h2>
192<h3 class=fn><a name="QMenuBar"></a>QMenuBar::QMenuBar ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;parent = 0, const&nbsp;char&nbsp;*&nbsp;name = 0 )
193</h3>
194Constructs a menu bar called <em>name</em> with parent <em>parent</em>.
195
196<h3 class=fn><a name="~QMenuBar"></a>QMenuBar::~QMenuBar ()
197</h3>
198Destroys the menu bar.
199
200<h3 class=fn>void <a name="activated"></a>QMenuBar::activated ( int&nbsp;id )<tt> [signal]</tt>
201</h3>
202
203<p> This signal is emitted when a menu item is selected; <em>id</em> is the
204id of the selected item.
205<p> Normally you will connect each menu item to a single slot using
206<a href="qmenudata.html#insertItem">QMenuData::insertItem</a>(), but sometimes you will want to connect
207several items to a single slot (most often if the user selects
208from an array). This signal is useful in such cases.
209<p> <p>See also <a href="#highlighted">highlighted</a>() and <a href="qmenudata.html#insertItem">QMenuData::insertItem</a>().
210
211<p>Example: <a href="progress-example.html#x67">progress/progress.cpp</a>.
212<h3 class=fn>void <a name="clear"></a>QMenuData::clear ()
213</h3>
214Removes all menu items.
215<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>() and <a href="qmenudata.html#removeItemAt">removeItemAt</a>().
216
217<p>Examples: <a href="mdi-example.html#x2029">mdi/application.cpp</a> and <a href="qwerty-example.html#x370">qwerty/qwerty.cpp</a>.
218<h3 class=fn>void <a name="drawContents"></a>QMenuBar::drawContents ( <a href="qpainter.html">QPainter</a>&nbsp;*&nbsp;p )<tt> [virtual protected]</tt>
219</h3>
220Called from <a href="qframe.html#paintEvent">QFrame::paintEvent</a>(). Draws the menu bar contents
221using painter <em>p</em>.
222
223<p>Reimplemented from <a href="qframe.html#drawContents">QFrame</a>.
224<h3 class=fn>int <a name="heightForWidth"></a>QMenuBar::heightForWidth ( int&nbsp;max_width ) const<tt> [virtual]</tt>
225</h3>
226Returns the height that the menu would resize itself to if its
227parent (and hence itself) resized to the given <em>max_width</em>. This
228can be useful for simple layout tasks in which the height of the
229menu bar is needed after items have been inserted. See <a href="showimg-example.html">showimg/showimg.cpp</a> for an example of the usage.
230
231<p>Example: <a href="showimg-example.html#x1325">showimg/showimg.cpp</a>.
232<p>Reimplemented from <a href="qwidget.html#heightForWidth">QWidget</a>.
233<h3 class=fn>void <a name="hide"></a>QMenuBar::hide ()<tt> [virtual]</tt>
234</h3>
235Reimplements <a href="qwidget.html#hide">QWidget::hide</a>() in order to deselect any selected
236item, and calls setUpLayout() for the main window.
237
238<p>Example: <a href="grapher-nsplugin-example.html#x2745">grapher/grapher.cpp</a>.
239<p>Reimplemented from <a href="qwidget.html#hide">QWidget</a>.
240<h3 class=fn>void <a name="highlighted"></a>QMenuBar::highlighted ( int&nbsp;id )<tt> [signal]</tt>
241</h3>
242
243<p> This signal is emitted when a menu item is highlighted; <em>id</em> is
244the id of the highlighted item.
245<p> Normally, you will connect each menu item to a single slot using
246<a href="qmenudata.html#insertItem">QMenuData::insertItem</a>(), but sometimes you will want to connect
247several items to a single slot (most often if the user selects
248from an array). This signal is useful in such cases.
249<p> <p>See also <a href="#activated">activated</a>() and <a href="qmenudata.html#insertItem">QMenuData::insertItem</a>().
250
251<h3 class=fn>int <a name="insertItem"></a>QMenuData::insertItem ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, const&nbsp;<a href="qobject.html">QObject</a>&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )
252</h3>
253The family of <a href="qmenudata.html#insertItem">insertItem</a>() functions inserts menu items into a
254popup menu or a menu bar.
255<p> A menu item is usually either a text string or a pixmap, both with
256an optional icon or keyboard accelerator. For special cases it is
257also possible to insert custom items (see <a href="qcustommenuitem.html">QCustomMenuItem</a>) or
258even widgets into popup menus.
259<p> Some insertItem() members take a popup menu as an additional
260argument. Use this to insert submenus into existing menus or
261pulldown menus into a menu bar.
262<p> The number of insert functions may look confusing, but they are
263actually quite simple to use.
264<p> This default version inserts a menu item with the text <em>text</em>,
265the accelerator key <em>accel</em>, an id and an optional index and
266connects it to the slot <em>member</em> in the object <em>receiver</em>.
267<p> Example:
268<pre>
269 QMenuBar *mainMenu = new QMenuBar;
270 <a href="qpopupmenu.html">QPopupMenu</a> *fileMenu = new <a href="qpopupmenu.html">QPopupMenu</a>;
271 fileMenu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "New", myView, SLOT(newFile()), CTRL+Key_N );
272 fileMenu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Open", myView, SLOT(open()), CTRL+Key_O );
273 mainMenu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "File", fileMenu );
274 </pre>
275
276<p> Not all insert functions take an object/slot parameter or an
277accelerator key. Use <a href="qmenudata.html#connectItem">connectItem</a>() and <a href="qmenudata.html#setAccel">setAccel</a>() on those items.
278<p> If you need to translate accelerators, use <a href="qobject.html#tr">tr</a>() with the text and
279accelerator. (For translations use a string <a href="qkeysequence.html">key
280 sequence</a>.):
281<pre>
282 fileMenu-&gt;insertItem( <a href="qobject.html#tr">tr</a>("Open"), myView, SLOT(open()),
283 <a href="qobject.html#tr">tr</a>("Ctrl+O") );
284 </pre>
285
286<p> In the example above, pressing Ctrl+O or selecting "Open" from the
287menu activates the myView->open() function.
288<p> Some insert functions take a <a href="qiconset.html">QIconSet</a> parameter to specify the
289little menu item icon. Note that you can always pass a <a href="qpixmap.html">QPixmap</a>
290object instead.
291<p> The <em>id</em> specifies the identification number associated with the
292menu item. Note that only positive values are valid, as a negative
293value will make Qt select a unique id for the item.
294<p> The <em>index</em> specifies the position in the menu. The menu item is
295appended at the end of the list if <em>index</em> is negative.
296<p> Note that keyboard accelerators in Qt are not application-global,
297instead they are bound to a certain top-level window. For example,
298accelerators in <a href="qpopupmenu.html">QPopupMenu</a> items only work for menus that are
299associated with a certain window. This is true for popup menus
300that live in a menu bar since their accelerators will then be
301installed in the menu bar itself. This also applies to stand-alone
302popup menus that have a top-level widget in their <a href="qwidget.html#parentWidget">parentWidget</a>()
303chain. The menu will then install its accelerator object on that
304top-level widget. For all other cases use an independent <a href="qaccel.html">QAccel</a>
305object.
306<p> <b>Warning:</b> Be careful when passing a literal 0 to <a href="qmenudata.html#insertItem">insertItem</a>()
307because some C++ compilers choose the wrong overloaded function.
308Cast the 0 to what you mean, e.g. <tt>(QObject*)0</tt>.
309<p> <b>Warning:</b> On Mac OS X, items that connect to a slot that are inserted into a
310menubar will not function as we use the native menubar that knows nothing
311about signals or slots. Instead insert the items into a popup menu and
312insert the popup menu into the menubar. This may be fixed in a future Qt
313version.
314<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
315<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), <a href="qmenudata.html#connectItem">connectItem</a>(), <a href="qaccel.html">QAccel</a>, and <a href="qnamespace-h.html">qnamespace.h</a>.
316
317<p>Examples: <a href="addressbook-example.html#x569">addressbook/mainwindow.cpp</a>, <a href="canvas-example.html#x2936">canvas/canvas.cpp</a>, <a href="menu-example.html#x1869">menu/menu.cpp</a>, <a href="qwerty-example.html#x371">qwerty/qwerty.cpp</a>, <a href="scrollview-example.html#x634">scrollview/scrollview.cpp</a>, <a href="showimg-example.html#x1327">showimg/showimg.cpp</a>, and <a href="sound-example.html#x2810">sound/sound.cpp</a>.
318<h3 class=fn>int <a name="insertItem-2"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, const&nbsp;<a href="qobject.html">QObject</a>&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )
319</h3>
320This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
321<p> Inserts a menu item with icon <em>icon</em>, text <em>text</em>, accelerator
322<em>accel</em>, optional id <em>id</em>, and optional <em>index</em> position. The
323menu item is connected it to the <em>receiver</em>'s <em>member</em> slot. The
324icon will be displayed to the left of the text in the item.
325<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
326<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), <a href="qmenudata.html#connectItem">connectItem</a>(), <a href="qaccel.html">QAccel</a>, and <a href="qnamespace-h.html">qnamespace.h</a>.
327
328<h3 class=fn>int <a name="insertItem-3"></a>QMenuData::insertItem ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, const&nbsp;<a href="qobject.html">QObject</a>&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )
329</h3>
330This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
331<p> Inserts a menu item with pixmap <em>pixmap</em>, accelerator <em>accel</em>,
332optional id <em>id</em>, and optional <em>index</em> position. The menu item
333is connected it to the <em>receiver</em>'s <em>member</em> slot. The icon will
334be displayed to the left of the text in the item.
335<p> To look best when being highlighted as a menu item, the pixmap
336should provide a mask (see <a href="qpixmap.html#mask">QPixmap::mask</a>()).
337<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
338<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
339
340<h3 class=fn>int <a name="insertItem-4"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, const&nbsp;<a href="qobject.html">QObject</a>&nbsp;*&nbsp;receiver, const&nbsp;char&nbsp;*&nbsp;member, const&nbsp;<a href="qkeysequence.html">QKeySequence</a>&nbsp;&amp;&nbsp;accel = 0, int&nbsp;id = -1, int&nbsp;index = -1 )
341</h3>
342This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
343<p> Inserts a menu item with icon <em>icon</em>, pixmap <em>pixmap</em>,
344accelerator <em>accel</em>, optional id <em>id</em>, and optional <em>index</em>
345position. The icon will be displayed to the left of the pixmap in
346the item. The item is connected to the <em>member</em> slot in the <em>receiver</em> object.
347<p> To look best when being highlighted as a menu item, the pixmap
348should provide a mask (see <a href="qpixmap.html#mask">QPixmap::mask</a>()).
349<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
350<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), <a href="qmenudata.html#connectItem">connectItem</a>(), <a href="qaccel.html">QAccel</a>, and <a href="qnamespace-h.html">qnamespace.h</a>.
351
352<h3 class=fn>int <a name="insertItem-5"></a>QMenuData::insertItem ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, int&nbsp;id = -1, int&nbsp;index = -1 )
353</h3>
354This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
355<p> Inserts a menu item with text <em>text</em>, optional id <em>id</em>, and
356optional <em>index</em> position.
357<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
358<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
359
360<h3 class=fn>int <a name="insertItem-6"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, int&nbsp;id = -1, int&nbsp;index = -1 )
361</h3>
362This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
363<p> Inserts a menu item with icon <em>icon</em>, text <em>text</em>, optional id
364<em>id</em>, and optional <em>index</em> position. The icon will be displayed
365to the left of the text in the item.
366<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
367<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
368
369<h3 class=fn>int <a name="insertItem-7"></a>QMenuData::insertItem ( const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qpopupmenu.html">QPopupMenu</a>&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )
370</h3>
371This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
372<p> Inserts a menu item with text <em>text</em>, submenu <em>popup</em>, optional
373id <em>id</em>, and optional <em>index</em> position.
374<p> The <em>popup</em> must be deleted by the programmer or by its parent
375widget. It is not deleted when this menu item is removed or when
376the menu is deleted.
377<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
378<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
379
380<h3 class=fn>int <a name="insertItem-8"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qstring.html">QString</a>&nbsp;&amp;&nbsp;text, <a href="qpopupmenu.html">QPopupMenu</a>&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )
381</h3>
382This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
383<p> Inserts a menu item with icon <em>icon</em>, text <em>text</em>, submenu <em>popup</em>, optional id <em>id</em>, and optional <em>index</em> position. The icon
384will be displayed to the left of the text in the item.
385<p> The <em>popup</em> must be deleted by the programmer or by its parent
386widget. It is not deleted when this menu item is removed or when
387the menu is deleted.
388<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
389<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
390
391<h3 class=fn>int <a name="insertItem-9"></a>QMenuData::insertItem ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, int&nbsp;id = -1, int&nbsp;index = -1 )
392</h3>
393This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
394<p> Inserts a menu item with pixmap <em>pixmap</em>, optional id <em>id</em>, and
395optional <em>index</em> position.
396<p> To look best when being highlighted as a menu item, the pixmap
397should provide a mask (see <a href="qpixmap.html#mask">QPixmap::mask</a>()).
398<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
399<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
400
401<h3 class=fn>int <a name="insertItem-a"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, int&nbsp;id = -1, int&nbsp;index = -1 )
402</h3>
403This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
404<p> Inserts a menu item with icon <em>icon</em>, pixmap <em>pixmap</em>, optional
405id <em>id</em>, and optional <em>index</em> position. The icon will be
406displayed to the left of the pixmap in the item.
407<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
408<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
409
410<h3 class=fn>int <a name="insertItem-b"></a>QMenuData::insertItem ( const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, <a href="qpopupmenu.html">QPopupMenu</a>&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )
411</h3>
412This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
413<p> Inserts a menu item with pixmap <em>pixmap</em>, submenu <em>popup</em>,
414optional id <em>id</em>, and optional <em>index</em> position.
415<p> The <em>popup</em> must be deleted by the programmer or by its parent
416widget. It is not deleted when this menu item is removed or when
417the menu is deleted.
418<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
419<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
420
421<h3 class=fn>int <a name="insertItem-c"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, const&nbsp;<a href="qpixmap.html">QPixmap</a>&nbsp;&amp;&nbsp;pixmap, <a href="qpopupmenu.html">QPopupMenu</a>&nbsp;*&nbsp;popup, int&nbsp;id = -1, int&nbsp;index = -1 )
422</h3>
423This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
424<p> Inserts a menu item with icon <em>icon</em>, pixmap <em>pixmap</em> submenu <em>popup</em>, optional id <em>id</em>, and optional <em>index</em> position. The icon
425will be displayed to the left of the pixmap in the item.
426<p> The <em>popup</em> must be deleted by the programmer or by its parent
427widget. It is not deleted when this menu item is removed or when
428the menu is deleted.
429<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
430<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>(), <a href="qmenudata.html#changeItem">changeItem</a>(), <a href="qmenudata.html#setAccel">setAccel</a>(), and <a href="qmenudata.html#connectItem">connectItem</a>().
431
432<h3 class=fn>int <a name="insertItem-d"></a>QMenuData::insertItem ( <a href="qwidget.html">QWidget</a>&nbsp;*&nbsp;widget, int&nbsp;id = -1, int&nbsp;index = -1 )
433</h3>
434This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
435<p> Inserts a menu item that consists of the widget <em>widget</em> with
436optional id <em>id</em>, and optional <em>index</em> position.
437<p> Ownership of <em>widget</em> is transferred to the popup menu or to the
438menu bar.
439<p> Theoretically, any widget can be inserted into a popup menu. In
440practice, this only makes sense with certain widgets.
441<p> If a widget is not focus-enabled (see
442<a href="qwidget.html#isFocusEnabled">QWidget::isFocusEnabled</a>()), the menu treats it as a separator;
443this means that the item is not selectable and will never get
444focus. In this way you can, for example, simply insert a <a href="qlabel.html">QLabel</a> if
445you need a popup menu with a title.
446<p> If the widget is focus-enabled it will get focus when the user
447traverses the popup menu with the arrow keys. If the widget does
448not accept <tt>ArrowUp</tt> and <tt>ArrowDown</tt> in its key event handler,
449the focus will move back to the menu when the respective arrow key
450is hit one more time. This works with a <a href="qlineedit.html">QLineEdit</a>, for example. If
451the widget accepts the arrow key itself, it must also provide the
452possibility to put the focus back on the menu again by calling
453<a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>(). Futhermore, if the embedded widget
454closes the menu when the user made a selection, this can be done
455safely by calling:
456<pre>
457 if ( <a href="qwidget.html#isVisible">isVisible</a>() &amp;&amp;
458 <a href="qwidget.html#parentWidget">parentWidget</a>() &amp;&amp;
459 <a href="qwidget.html#parentWidget">parentWidget</a>()-&gt;inherits("QPopupMenu") )
460 <a href="qwidget.html#parentWidget">parentWidget</a>()-&gt;close();
461 </pre>
462
463<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
464<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>().
465
466<h3 class=fn>int <a name="insertItem-e"></a>QMenuData::insertItem ( const&nbsp;<a href="qiconset.html">QIconSet</a>&nbsp;&amp;&nbsp;icon, <a href="qcustommenuitem.html">QCustomMenuItem</a>&nbsp;*&nbsp;custom, int&nbsp;id = -1, int&nbsp;index = -1 )
467</h3>
468This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
469<p> Inserts a custom menu item <em>custom</em> with an <em>icon</em> and with
470optional id <em>id</em>, and optional <em>index</em> position.
471<p> This only works with popup menus. It is not supported for menu
472bars. Ownership of <em>custom</em> is transferred to the popup menu.
473<p> If you want to connect a custom item to a slot, use <a href="qmenudata.html#connectItem">connectItem</a>().
474<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
475<p> <p>See also <a href="qmenudata.html#connectItem">connectItem</a>(), <a href="qmenudata.html#removeItem">removeItem</a>(), and <a href="qcustommenuitem.html">QCustomMenuItem</a>.
476
477<h3 class=fn>int <a name="insertItem-f"></a>QMenuData::insertItem ( <a href="qcustommenuitem.html">QCustomMenuItem</a>&nbsp;*&nbsp;custom, int&nbsp;id = -1, int&nbsp;index = -1 )
478</h3>
479This is an overloaded member function, provided for convenience. It behaves essentially like the above function.
480<p> Inserts a custom menu item <em>custom</em> with optional id <em>id</em>, and
481optional <em>index</em> position.
482<p> This only works with popup menus. It is not supported for menu
483bars. Ownership of <em>custom</em> is transferred to the popup menu.
484<p> If you want to connect a custom item to a slot, use <a href="qmenudata.html#connectItem">connectItem</a>().
485<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).
486<p> <p>See also <a href="qmenudata.html#connectItem">connectItem</a>(), <a href="qmenudata.html#removeItem">removeItem</a>(), and <a href="qcustommenuitem.html">QCustomMenuItem</a>.
487
488<h3 class=fn>int <a name="insertSeparator"></a>QMenuData::insertSeparator ( int&nbsp;index = -1 )
489</h3>
490Inserts a separator at position <em>index</em>, and returns the <a href="qmenudata.html#menu-identifier">menu identifier</a>
491number allocated to it. The separator becomes the last menu item if
492<em>index</em> is negative.
493<p> In a popup menu a separator is rendered as a horizontal line. In a
494<a href="motif-extension.html#Motif">Motif</a> menu bar a separator is spacing, so the rest of the items
495(normally just "Help") are drawn right-justified. In a Windows
496menu bar separators are ignored (to comply with the Windows style
497guidelines).
498
499<p>Examples: <a href="addressbook-example.html#x570">addressbook/mainwindow.cpp</a>, <a href="menu-example.html#x1870">menu/menu.cpp</a>, <a href="progress-example.html#x69">progress/progress.cpp</a>, <a href="qwerty-example.html#x372">qwerty/qwerty.cpp</a>, <a href="scrollview-example.html#x635">scrollview/scrollview.cpp</a>, <a href="showimg-example.html#x1328">showimg/showimg.cpp</a>, and <a href="sound-example.html#x2811">sound/sound.cpp</a>.
500<h3 class=fn>bool <a name="isDefaultUp"></a>QMenuBar::isDefaultUp () const
501</h3><p>Returns the popup orientation.
502See the <a href="qmenubar.html#defaultUp-prop">"defaultUp"</a> property for details.
503<h3 class=fn>bool <a name="isItemEnabled"></a>QMenuData::isItemEnabled ( int&nbsp;id ) const
504</h3>
505Returns TRUE if the item with identifier <em>id</em> is enabled;
506otherwise returns FALSE
507<p> <p>See also <a href="qmenudata.html#setItemEnabled">setItemEnabled</a>() and <a href="qmenudata.html#isItemVisible">isItemVisible</a>().
508
509<h3 class=fn>bool <a name="isItemVisible"></a>QMenuData::isItemVisible ( int&nbsp;id ) const
510</h3>
511Returns TRUE if the menu item with the id <em>id</em> is visible;
512otherwise returns FALSE.
513<p> <p>See also <a href="qmenudata.html#setItemVisible">setItemVisible</a>().
514
515<h3 class=fn>void <a name="menuContentsChanged"></a>QMenuBar::menuContentsChanged ()<tt> [virtual protected]</tt>
516</h3>
517Recomputes the menu bar's display data according to the new
518contents.
519<p> You should never need to call this; it is called automatically by
520<a href="qmenudata.html">QMenuData</a> whenever it needs to be called.
521
522<p>Reimplemented from <a href="qmenudata.html#menuContentsChanged">QMenuData</a>.
523<h3 class=fn>void <a name="menuStateChanged"></a>QMenuBar::menuStateChanged ()<tt> [virtual protected]</tt>
524</h3>
525Recomputes the menu bar's display data according to the new state.
526<p> You should never need to call this; it is called automatically by
527<a href="qmenudata.html">QMenuData</a> whenever it needs to be called.
528
529<p>Reimplemented from <a href="qmenudata.html#menuStateChanged">QMenuData</a>.
530<h3 class=fn>void <a name="removeItem"></a>QMenuData::removeItem ( int&nbsp;id )
531</h3>
532
533<p> Removes the menu item that has the identifier <em>id</em>.
534<p> <p>See also <a href="qmenudata.html#removeItemAt">removeItemAt</a>() and <a href="qmenudata.html#clear">clear</a>().
535
536<p>Example: <a href="canvas-chart-example.html#x2885">chart/chartform.cpp</a>.
537<h3 class=fn><a href="qmenubar.html#Separator-enum">Separator</a> <a name="separator"></a>QMenuBar::separator () const
538</h3><p>Returns in which cases a menubar sparator is drawn.
539See the <a href="qmenubar.html#separator-prop">"separator"</a> property for details.
540<h3 class=fn>void <a name="setDefaultUp"></a>QMenuBar::setDefaultUp ( bool )
541</h3><p>Sets the popup orientation.
542See the <a href="qmenubar.html#defaultUp-prop">"defaultUp"</a> property for details.
543<h3 class=fn>void <a name="setItemEnabled"></a>QMenuData::setItemEnabled ( int&nbsp;id, bool&nbsp;enable )
544</h3>
545If <em>enable</em> is TRUE, enables the menu item with identifier <em>id</em>;
546otherwise disables the menu item with identifier <em>id</em>.
547<p> <p>See also <a href="qmenudata.html#isItemEnabled">isItemEnabled</a>().
548
549<p>Examples: <a href="mdi-example.html#x2033">mdi/application.cpp</a>, <a href="menu-example.html#x1873">menu/menu.cpp</a>, <a href="progress-example.html#x72">progress/progress.cpp</a>, and <a href="showimg-example.html#x1331">showimg/showimg.cpp</a>.
550<h3 class=fn>void <a name="setItemVisible"></a>QMenuData::setItemVisible ( int&nbsp;id, bool&nbsp;visible )
551</h3>
552If <em>visible</em> is TRUE, shows the menu item with id <em>id</em>; otherwise
553hides the menu item with id <em>id</em>.
554<p> <p>See also <a href="qmenudata.html#isItemVisible">isItemVisible</a>() and <a href="qmenudata.html#isItemEnabled">isItemEnabled</a>().
555
556<h3 class=fn>void <a name="setSeparator"></a>QMenuBar::setSeparator ( <a href="qmenubar.html#Separator-enum">Separator</a>&nbsp;when )<tt> [virtual]</tt>
557</h3><p>Sets in which cases a menubar sparator is drawn to <em>when</em>.
558See the <a href="qmenubar.html#separator-prop">"separator"</a> property for details.
559<h3 class=fn>void <a name="show"></a>QMenuBar::show ()<tt> [virtual]</tt>
560</h3>
561Reimplements <a href="qwidget.html#show">QWidget::show</a>() in order to set up the correct
562keyboard accelerators and to raise itself to the top of the widget
563stack.
564
565<p>Example: <a href="grapher-nsplugin-example.html#x2746">grapher/grapher.cpp</a>.
566<p>Reimplemented from <a href="qwidget.html#show">QWidget</a>.
567<hr><h2>Property Documentation</h2>
568<h3 class=fn>bool <a name="defaultUp-prop"></a>defaultUp</h3>
569<p>This property holds the popup orientation.
570<p>The default popup orientation. By default, menus pop "down" the
571screen. By setting the property to TRUE, the menu will pop "up".
572You might call this for menus that are <em>below</em> the document to
573which they refer.
574<p> If the menu would not fit on the screen, the other direction is
575used automatically.
576
577<p>Set this property's value with <a href="#setDefaultUp">setDefaultUp</a>() and get this property's value with <a href="#isDefaultUp">isDefaultUp</a>().
578<h3 class=fn><a href="qmenubar.html#Separator-enum">Separator</a> <a name="separator-prop"></a>separator</h3>
579<p>This property holds in which cases a menubar sparator is drawn.
580<p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.
581<p>
582<p>Set this property's value with <a href="#setSeparator">setSeparator</a>() and get this property's value with <a href="#separator">separator</a>().
583<!-- eof -->
584<hr><p>
585This file is part of the <a href="index.html">Qt toolkit</a>.
586Copyright &copy; 1995-2007
587<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center>
588<table width=100% cellspacing=0 border=0><tr>
589<td>Copyright &copy; 2007
590<a href="troll.html">Trolltech</a><td align=center><a href="trademarks.html">Trademarks</a>
591<td align=right><div align=right>Qt 3.3.8</div>
592</table></div></address></body>
593</html>
Note: See TracBrowser for help on using the repository browser.