Sophie

Sophie

distrib > Fedora > 18 > x86_64 > by-pkgid > ff187cb994c94c614ecc64c5a8528b1b > files > 5739

qt-doc-4.8.5-10.fc18.noarch.rpm

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en_US" lang="en_US">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<!-- qmenubar.cpp -->
  <title>Qt 4.8: QMenuBar Class Reference</title>
  <link rel="stylesheet" type="text/css" href="style/style.css" />
  <script src="scripts/jquery.js" type="text/javascript"></script>
  <script src="scripts/functions.js" type="text/javascript"></script>
  <link rel="stylesheet" type="text/css" href="style/superfish.css" />
  <link rel="stylesheet" type="text/css" href="style/narrow.css" />
  <!--[if IE]>
<meta name="MSSmartTagsPreventParsing" content="true">
<meta http-equiv="imagetoolbar" content="no">
<![endif]-->
<!--[if lt IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie6.css">
<![endif]-->
<!--[if IE 7]>
<link rel="stylesheet" type="text/css" href="style/style_ie7.css">
<![endif]-->
<!--[if IE 8]>
<link rel="stylesheet" type="text/css" href="style/style_ie8.css">
<![endif]-->

<script src="scripts/superfish.js" type="text/javascript"></script>
<script src="scripts/narrow.js" type="text/javascript"></script>

</head>
<body class="" onload="CheckEmptyAndLoadList();">
 <div class="header" id="qtdocheader">
    <div class="content"> 
    <div id="nav-logo">
      <a href="index.html">Home</a></div>
    <a href="index.html" class="qtref"><span>Qt Reference Documentation</span></a>
    <div id="narrowsearch"></div>
    <div id="nav-topright">
      <ul>
        <li class="nav-topright-home"><a href="http://qt.digia.com/">Qt HOME</a></li>
        <li class="nav-topright-dev"><a href="http://qt-project.org/">DEV</a></li>
        <li class="nav-topright-doc nav-topright-doc-active"><a href="http://qt-project.org/doc/">
          DOC</a></li>
        <li class="nav-topright-blog"><a href="http://blog.qt.digia.com/">BLOG</a></li>
      </ul>
    </div>
    <div id="shortCut">
      <ul>
        <li class="shortCut-topleft-inactive"><span><a href="index.html">Qt 4.8</a></span></li>
        <li class="shortCut-topleft-active"><a href="http://qt-project.org/doc/">ALL VERSIONS        </a></li>
      </ul>
     </div>
 <ul class="sf-menu" id="narrowmenu"> 
             <li><a href="#">API Lookup</a> 
                 <ul> 
                     <li><a href="classes.html">Class index</a></li> 
           <li><a href="functions.html">Function index</a></li> 
           <li><a href="modules.html">Modules</a></li> 
           <li><a href="namespaces.html">Namespaces</a></li> 
           <li><a href="qtglobal.html">Global Declarations</a></li> 
           <li><a href="qdeclarativeelements.html">QML elements</a></li> 
             </ul> 
             </li> 
             <li><a href="#">Qt Topics</a> 
                 <ul> 
                        <li><a href="qt-basic-concepts.html">Programming with Qt</a></li>  
                        <li><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li>  
                        <li><a href="qt-gui-concepts.html">UI Design with Qt</a></li>  
                        <li><a href="supported-platforms.html">Supported Platforms</a></li>  
                        <li><a href="technology-apis.html">Qt and Key Technologies</a></li>  
                        <li><a href="best-practices.html">How-To's and Best Practices</a></li>  
              </ul> 
                 </li> 
                 <li><a href="#">Examples</a> 
                     <ul> 
                       <li><a href="all-examples.html">Examples</a></li> 
                       <li><a href="tutorials.html">Tutorials</a></li> 
                       <li><a href="demos.html">Demos</a></li> 
                       <li><a href="qdeclarativeexamples.html">QML Examples</a></li> 
                </ul> 
                     </li> 
                 </ul> 
    </div>
  </div>
  <div class="wrapper">
    <div class="hd">
      <span></span>
    </div>
    <div class="bd group">
      <div class="sidebar">
        <div class="searchlabel">
          Search index:</div>
        <div class="search" id="sidebarsearch">
          <form id="qtdocsearch" action="" onsubmit="return false;">
            <fieldset>
              <input type="text" name="searchstring" id="pageType" value="" />
 <div id="resultdialog"> 
 <a href="#" id="resultclose">Close</a> 
 <p id="resultlinks" class="all"><a href="#" id="showallresults">All</a> | <a href="#" id="showapiresults">API</a> | <a href="#" id="showarticleresults">Articles</a> | <a href="#" id="showexampleresults">Examples</a></p> 
 <p id="searchcount" class="all"><span id="resultcount"></span><span id="apicount"></span><span id="articlecount"></span><span id="examplecount"></span>&nbsp;results:</p> 
 <ul id="resultlist" class="all"> 
 </ul> 
 </div> 
            </fieldset>
          </form>
        </div>
        <div class="box first bottombar" id="lookup">
          <h2 title="API Lookup"><span></span>
            API Lookup</h2>
          <div  id="list001" class="list">
          <ul id="ul001" >
              <li class="defaultLink"><a href="classes.html">Class index</a></li>
              <li class="defaultLink"><a href="functions.html">Function index</a></li>
              <li class="defaultLink"><a href="modules.html">Modules</a></li>
              <li class="defaultLink"><a href="namespaces.html">Namespaces</a></li>
              <li class="defaultLink"><a href="qtglobal.html">Global Declarations</a></li>
              <li class="defaultLink"><a href="qdeclarativeelements.html">QML elements</a></li>
            </ul> 
          </div>
        </div>
        <div class="box bottombar" id="topics">
          <h2 title="Qt Topics"><span></span>
            Qt Topics</h2>
          <div id="list002" class="list">
            <ul id="ul002" >
               <li class="defaultLink"><a href="qt-basic-concepts.html">Programming with Qt</a></li> 
               <li class="defaultLink"><a href="qtquick.html">Device UIs &amp; Qt Quick</a></li> 
               <li class="defaultLink"><a href="qt-gui-concepts.html">UI Design with Qt</a></li> 
               <li class="defaultLink"><a href="supported-platforms.html">Supported Platforms</a></li>  
               <li class="defaultLink"><a href="technology-apis.html">Qt and Key Technologies</a></li> 
               <li class="defaultLink"><a href="best-practices.html">How-To's and Best Practices</a></li> 
            </ul>  
          </div>
        </div>
        <div class="box" id="examples">
          <h2 title="Examples"><span></span>
            Examples</h2>
          <div id="list003" class="list">
        <ul id="ul003">
              <li class="defaultLink"><a href="all-examples.html">Examples</a></li>
              <li class="defaultLink"><a href="tutorials.html">Tutorials</a></li>
              <li class="defaultLink"><a href="demos.html">Demos</a></li>
              <li class="defaultLink"><a href="qdeclarativeexamples.html">QML Examples</a></li>
            </ul> 
          </div>
        </div>
      </div>
      <div class="wrap">
        <div class="toolbar">
          <div class="breadcrumb toolblock">
            <ul>
              <li class="first"><a href="index.html">Home</a></li>
              <!--  Breadcrumbs go here -->
<li><a href="modules.html">Modules</a></li>
<li><a href="qtgui.html">QtGui</a></li>
<li>QMenuBar</li>
            </ul>
          </div>
          <div class="toolbuttons toolblock">
            <ul>
              <li id="smallA" class="t_button">A</li>
              <li id="medA" class="t_button active">A</li>
              <li id="bigA" class="t_button">A</li>
              <li id="print" class="t_button"><a href="javascript:this.print();">
                <span>Print</span></a></li>
            </ul>
        </div>
        </div>
        <div class="content mainContent">
<div class="toc">
<h3><a name="toc">Contents</a></h3>
<ul>
<li class="level1"><a href="#properties">Properties</a></li>
<li class="level1"><a href="#public-functions">Public Functions</a></li>
<li class="level1"><a href="#public-slots">Public Slots</a></li>
<li class="level1"><a href="#signals">Signals</a></li>
<li class="level1"><a href="#protected-functions">Protected Functions</a></li>
<li class="level1"><a href="#details">Detailed Description</a></li>
<li class="level2"><a href="#usage">Usage</a></li>
<li class="level2"><a href="#platform-dependent-look-and-feel">Platform Dependent Look and Feel</a></li>
<li class="level2"><a href="#qmenubar-on-mac-os-x">QMenuBar on Mac OS X</a></li>
<li class="level2"><a href="#qmenubar-on-windows-ce">QMenuBar on Windows CE</a></li>
<li class="level2"><a href="#examples">Examples</a></li>
</ul>
</div>
<h1 class="title">QMenuBar Class Reference</h1>
<!-- $$$QMenuBar-brief -->
<p>The QMenuBar class provides a horizontal menu bar. <a href="#details">More...</a></p>
<!-- @@@QMenuBar -->
<pre class="cpp"> <span class="preprocessor">#include &lt;QMenuBar&gt;</span></pre><p><b>Inherits: </b><a href="qwidget.html">QWidget</a>.</p>
<ul>
<li><a href="qmenubar-members.html">List of all members, including inherited members</a></li>
<li><a href="qmenubar-qt3.html">Qt 3 support members</a></li>
</ul>
<a name="properties"></a>
<h2>Properties</h2>
<ul>
<li class="fn"><b><a href="qmenubar.html#defaultUp-prop">defaultUp</a></b> : bool</li>
<li class="fn"><b><a href="qmenubar.html#nativeMenuBar-prop">nativeMenuBar</a></b> : bool</li>
</ul>
<ul>
<li class="fn">58 properties inherited from <a href="qwidget.html#properties">QWidget</a></li>
<li class="fn">1 property inherited from <a href="qobject.html#properties">QObject</a></li>
</ul>
<a name="public-functions"></a>
<h2>Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#QMenuBar">QMenuBar</a></b> ( QWidget * <i>parent</i> = 0 )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#dtor.QMenuBar">~QMenuBar</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#actionAt">actionAt</a></b> ( const QPoint &amp; <i>pt</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QRect </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#actionGeometry">actionGeometry</a></b> ( QAction * <i>act</i> ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#activeAction">activeAction</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addAction">addAction</a></b> ( const QString &amp; <i>text</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addAction-2">addAction</a></b> ( const QString &amp; <i>text</i>, const QObject * <i>receiver</i>, const char * <i>member</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addAction-3">addAction</a></b> ( QAction * <i>action</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addMenu">addMenu</a></b> ( QMenu * <i>menu</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addMenu-2">addMenu</a></b> ( const QString &amp; <i>title</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QMenu * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addMenu-3">addMenu</a></b> ( const QIcon &amp; <i>icon</i>, const QString &amp; <i>title</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#addSeparator">addSeparator</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#clear">clear</a></b> ()</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QWidget * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#cornerWidget">cornerWidget</a></b> ( Qt::Corner <i>corner</i> = Qt::TopRightCorner ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#defaultAction">defaultAction</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#insertMenu">insertMenu</a></b> ( QAction * <i>before</i>, QMenu * <i>menu</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> QAction * </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#insertSeparator">insertSeparator</a></b> ( QAction * <i>before</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#defaultUp-prop">isDefaultUp</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> bool </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#nativeMenuBar-prop">isNativeMenuBar</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#setActiveAction">setActiveAction</a></b> ( QAction * <i>act</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#setCornerWidget">setCornerWidget</a></b> ( QWidget * <i>widget</i>, Qt::Corner <i>corner</i> = Qt::TopRightCorner )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#setDefaultAction">setDefaultAction</a></b> ( QAction * <i>act</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#defaultUp-prop">setDefaultUp</a></b> ( bool )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#nativeMenuBar-prop">setNativeMenuBar</a></b> ( bool <i>nativeMenuBar</i> )</td></tr>
</table>
<a name="reimplemented-public-functions"></a>
<h2>Reimplemented Public Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual int </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#heightForWidth">heightForWidth</a></b> ( int ) const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#minimumSizeHint">minimumSizeHint</a></b> () const</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual QSize </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#sizeHint">sizeHint</a></b> () const</td></tr>
</table>
<ul>
<li class="fn">221 public functions inherited from <a href="qwidget.html#public-functions">QWidget</a></li>
<li class="fn">29 public functions inherited from <a href="qobject.html#public-functions">QObject</a></li>
<li class="fn">13 public functions inherited from <a href="qpaintdevice.html#public-functions">QPaintDevice</a></li>
</ul>
<a name="public-slots"></a>
<h2>Public Slots</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#setVisible">setVisible</a></b> ( bool <i>visible</i> )</td></tr>
</table>
<ul>
<li class="fn">19 public slots inherited from <a href="qwidget.html#public-slots">QWidget</a></li>
<li class="fn">1 public slot inherited from <a href="qobject.html#public-slots">QObject</a></li>
</ul>
<a name="signals"></a>
<h2>Signals</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#hovered">hovered</a></b> ( QAction * <i>action</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#triggered">triggered</a></b> ( QAction * <i>action</i> )</td></tr>
</table>
<ul>
<li class="fn">1 signal inherited from <a href="qwidget.html#signals">QWidget</a></li>
<li class="fn">1 signal inherited from <a href="qobject.html#signals">QObject</a></li>
</ul>
<a name="protected-functions"></a>
<h2>Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#initStyleOption">initStyleOption</a></b> ( QStyleOptionMenuItem * <i>option</i>, const QAction * <i>action</i> ) const</td></tr>
</table>
<a name="reimplemented-protected-functions"></a>
<h2>Reimplemented Protected Functions</h2>
<table class="alignedsummary">
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#actionEvent">actionEvent</a></b> ( QActionEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#changeEvent">changeEvent</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#event">event</a></b> ( QEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual bool </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#eventFilter">eventFilter</a></b> ( QObject * <i>object</i>, QEvent * <i>event</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#focusInEvent">focusInEvent</a></b> ( QFocusEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#focusOutEvent">focusOutEvent</a></b> ( QFocusEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#keyPressEvent">keyPressEvent</a></b> ( QKeyEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#leaveEvent">leaveEvent</a></b> ( QEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#mouseMoveEvent">mouseMoveEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#mousePressEvent">mousePressEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#mouseReleaseEvent">mouseReleaseEvent</a></b> ( QMouseEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#paintEvent">paintEvent</a></b> ( QPaintEvent * <i>e</i> )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#resizeEvent">resizeEvent</a></b> ( QResizeEvent * )</td></tr>
<tr><td class="memItemLeft rightAlign topAlign"> virtual void </td><td class="memItemRight bottomAlign"><b><a href="qmenubar.html#timerEvent">timerEvent</a></b> ( QTimerEvent * <i>e</i> )</td></tr>
</table>
<ul>
<li class="fn">37 protected functions inherited from <a href="qwidget.html#protected-functions">QWidget</a></li>
<li class="fn">8 protected functions inherited from <a href="qobject.html#protected-functions">QObject</a></li>
<li class="fn">1 protected function inherited from <a href="qpaintdevice.html#protected-functions">QPaintDevice</a></li>
</ul>
<h3>Additional Inherited Members</h3>
<ul>
<li class="fn">4 static public members inherited from <a href="qwidget.html#static-public-members">QWidget</a></li>
<li class="fn">7 static public members inherited from <a href="qobject.html#static-public-members">QObject</a></li>
<li class="fn">1 protected slot inherited from <a href="qwidget.html#protected-slots">QWidget</a></li>
</ul>
<a name="details"></a>
<!-- $$$QMenuBar-description -->
<div class="descr">
<h2>Detailed Description</h2>
<p>The QMenuBar class provides a horizontal menu bar.</p>
<p>A menu bar consists of a list of pull-down menu items. You add menu items with <a href="qmenubar.html#addMenu">addMenu</a>(). For example, asuming that <tt>menubar</tt> is a pointer to a QMenuBar and <tt>fileMenu</tt> is a pointer to a <a href="qmenu.html">QMenu</a>, the following statement inserts the menu into the menu bar:</p>
<pre class="cpp"> menubar<span class="operator">-</span><span class="operator">&gt;</span><a href="qmenubar.html#addMenu">addMenu</a>(fileMenu);</pre>
<p>The ampersand in the menu item's text sets Alt+F as a shortcut for this menu. (You can use &quot;&amp;&amp;&quot; to get a real ampersand in the menu bar.)</p>
<p>There is no need to lay out a menu bar. It automatically sets its own geometry to the top of the parent widget and changes it appropriately whenever the parent is resized.</p>
<a name="usage"></a>
<h3>Usage</h3>
<p>In most main window style applications you would use the <a href="qmainwindow.html#menuBar">menuBar()</a> function provided in <a href="qmainwindow.html">QMainWindow</a>, adding <a href="qmenu.html">QMenu</a>s to the menu bar and adding <a href="qaction.html">QAction</a>s to the pop-up menus.</p>
<p>Example (from the <a href="mainwindows-menus.html">Menus</a> example):</p>
<pre class="cpp">     fileMenu <span class="operator">=</span> menuBar()<span class="operator">-</span><span class="operator">&gt;</span>addMenu(tr(<span class="string">&quot;&amp;File&quot;</span>));
     fileMenu<span class="operator">-</span><span class="operator">&gt;</span>addAction(newAct);</pre>
<p>Menu items may be removed with <a href="qwidget.html#removeAction">removeAction</a>().</p>
<p>Widgets can be added to menus by using instances of the <a href="qwidgetaction.html">QWidgetAction</a> class to hold them. These actions can then be inserted into menus in the usual way; see the <a href="qmenu.html">QMenu</a> documentation for more details.</p>
<a name="platform-dependent-look-and-feel"></a>
<h3>Platform Dependent Look and Feel</h3>
<p>Different platforms have different requirements for the appearance of menu bars and their behavior when the user interacts with them. For example, Windows systems are often configured so that the underlined character mnemonics that indicate keyboard shortcuts for items in the menu bar are only shown when the <b>Alt</b> key is pressed.</p>
<table class="generic">
<tr valign="top" class="odd"><td ><img src="images/plastique-menubar.png" alt="A menu bar shown in the" /> Plastique widget style.</td><td >The <a href="qplastiquestyle.html">Plastique widget style</a>, like most other styles, handles the <b>Help</b> menu in the same way as it handles any other menu.</td></tr>
<tr valign="top" class="even"><td ><img src="images/motif-menubar.png" alt="A menu bar shown in the" /> Motif widget style.</td><td >The <a href="qmotifstyle.html">Motif widget style</a> treats <b>Help</b> menus in a special way, placing them at right-hand end of the menu bar.</td></tr>
</table>
<a name="qmenubar-on-mac-os-x"></a>
<h3>QMenuBar on Mac OS X</h3>
<p>QMenuBar on Mac OS X is a wrapper for using the system-wide menu bar. If you have multiple menu bars in one dialog the outermost menu bar (normally inside a widget with widget flag <a href="qt.html#WindowType-enum">Qt::Window</a>) will be used for the system-wide menu bar.</p>
<p>Qt for Mac OS X also provides a menu bar merging feature to make QMenuBar conform more closely to accepted Mac OS X menu bar layout. The merging functionality is based on string matching the title of a <a href="qmenu.html">QMenu</a> entry. These strings are translated (using <a href="qobject.html#tr">QObject::tr</a>()) in the &quot;QMenuBar&quot; context. If an entry is moved its slots will still fire as if it was in the original place. The table below outlines the strings looked for and where the entry is placed if matched:</p>
<table class="generic">
<thead><tr class="qt-style"><th >String matches</th><th >Placement</th><th >Notes</th></tr></thead>
<tr valign="top" class="odd"><td >about.*</td><td >Application Menu | About &lt;application name&gt;</td><td >The application name is fetched from the <tt>Info.plist</tt> file (see note below). If this entry is not found no About item will appear in the Application Menu.</td></tr>
<tr valign="top" class="even"><td >config, options, setup, settings or preferences</td><td >Application Menu | Preferences</td><td >If this entry is not found the Settings item will be disabled</td></tr>
<tr valign="top" class="odd"><td >quit or exit</td><td >Application Menu | Quit &lt;application name&gt;</td><td >If this entry is not found a default Quit item will be created to call <a href="qcoreapplication.html#quit">QApplication::quit</a>()</td></tr>
</table>
<p>You can override this behavior by using the <a href="qaction.html#menuRole-prop">QAction::menuRole</a>() property.</p>
<p>If you want all windows in a Mac application to share one menu bar, you must create a menu bar that does not have a parent. Create a parent-less menu bar this way:</p>
<pre class="cpp"> <span class="type">QMenuBar</span> <span class="operator">*</span>menuBar <span class="operator">=</span> <span class="keyword">new</span> <span class="type">QMenuBar</span>(<span class="number">0</span>);</pre>
<p><b>Note:</b> Do <i>not</i> call <a href="qmainwindow.html#menuBar">QMainWindow::menuBar</a>() to create the shared menu bar, because that menu bar will have the <a href="qmainwindow.html">QMainWindow</a> as its parent. That menu bar would only be displayed for the parent <a href="qmainwindow.html">QMainWindow</a>.</p>
<p><b>Note:</b> The text used for the application name in the menu bar is obtained from the value set in the <tt>Info.plist</tt> file in the application's bundle. See <a href="deployment-mac.html">Deploying an Application on Mac OS X</a> for more information.</p>
<a name="qmenubar-on-windows-ce"></a>
<h3>QMenuBar on Windows CE</h3>
<p>QMenuBar on Windows CE is a wrapper for using the system-wide menu bar, similar to the Mac. This feature is activated for Windows Mobile and integrates QMenuBar with the native soft keys. The left soft key can be controlled with <a href="qmenubar.html#setDefaultAction">QMenuBar::setDefaultAction</a>() and the right soft key can be used to access the menu bar.</p>
<p>The <a href="qmenubar.html#hovered">hovered</a>() signal is not supported for the native menu integration. Also, it is not possible to display an icon in a native menu on Windows Mobile.</p>
<a name="examples"></a>
<h3>Examples</h3>
<p>The <a href="mainwindows-menus.html">Menus</a> example shows how to use QMenuBar and <a href="qmenu.html">QMenu</a>. The other <a href="examples-mainwindow.html">main window application examples</a> also provide menus using these classes.</p>
</div>
<p><b>See also </b><a href="qmenu.html">QMenu</a>, <a href="qshortcut.html">QShortcut</a>, <a href="qaction.html">QAction</a>, <a href="http://developer.apple.com/documentation/UserExperience/Conceptual/AppleHIGuidelines/XHIGIntro/XHIGIntro.html">Introduction to Apple Human Interface Guidelines</a>, <a href="guibooks.html#fowler">GUI Design Handbook: Menu Bar</a>, and <a href="mainwindows-menus.html">Menus Example</a>.</p>
<!-- @@@QMenuBar -->
<div class="prop">
<h2>Property Documentation</h2>
<!-- $$$defaultUp-prop$$$isDefaultUp$$$setDefaultUpbool -->
<h3 class="fn"><a name="defaultUp-prop"></a><span class="name">defaultUp</span> : <span class="type">bool</span></h3>
<p>This property holds the popup orientation.</p>
<p>The default popup orientation. By default, menus pop &quot;down&quot; the screen. By setting the property to true, the menu will pop &quot;up&quot;. You might call this for menus that are <i>below</i> the document to which they refer.</p>
<p>If the menu would not fit on the screen, the other direction is used automatically.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isDefaultUp</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setDefaultUp</b></span> ( bool )</td></tr>
</table>
<!-- @@@defaultUp -->
<!-- $$$nativeMenuBar-prop$$$isNativeMenuBar$$$setNativeMenuBarbool -->
<h3 class="fn"><a name="nativeMenuBar-prop"></a><span class="name">nativeMenuBar</span> : <span class="type">bool</span></h3>
<p>This property holds whether or not a menubar will be used as a native menubar on platforms that support it.</p>
<p>This property specifies whether or not the menubar should be used as a native menubar on platforms that support it. The currently supported platforms are Mac OS X and Windows CE. On these platforms if this property is true, the menubar is used in the native menubar and is not in the window of its parent, if false the menubar remains in the window. On other platforms the value of this attribute has no effect.</p>
<p>The default is to follow whether the <a href="qt.html#ApplicationAttribute-enum">Qt::AA_DontUseNativeMenuBar</a> attribute is set for the application. Explicitly settings this property overrides the presence (or abscence) of the attribute.</p>
<p>This property was introduced in Qt 4.6.</p>
<p><b>Access functions:</b></p>
<table class="alignedsummary">
<tr><td class="memItemLeft topAlign rightAlign"> bool </td><td class="memItemRight bottomAlign"><span class="name"><b>isNativeMenuBar</b></span> () const</td></tr>
<tr><td class="memItemLeft topAlign rightAlign"> void </td><td class="memItemRight bottomAlign"><span class="name"><b>setNativeMenuBar</b></span> ( bool <i>nativeMenuBar</i> )</td></tr>
</table>
<p><b>See also </b><a href="exportedfunctions.html#void-qt-mac-set-native-menubar-bool-enable">void-qt-mac-set-native-menubar-bool-enable</a>.</p>
<!-- @@@nativeMenuBar -->
</div>
<div class="func">
<h2>Member Function Documentation</h2>
<!-- $$$QMenuBar[overload1]$$$QMenuBarQWidget* -->
<h3 class="fn"><a name="QMenuBar"></a>QMenuBar::<span class="name">QMenuBar</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>parent</i> = 0 )</h3>
<p>Constructs a menu bar with parent <i>parent</i>.</p>
<!-- @@@QMenuBar -->
<!-- $$$~QMenuBar[overload1]$$$~QMenuBar -->
<h3 class="fn"><a name="dtor.QMenuBar"></a>QMenuBar::<span class="name">~QMenuBar</span> ()</h3>
<p>Destroys the menu bar.</p>
<!-- @@@~QMenuBar -->
<!-- $$$actionAt[overload1]$$$actionAtconstQPoint& -->
<h3 class="fn"><a name="actionAt"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">actionAt</span> ( const <span class="type"><a href="qpoint.html">QPoint</a></span> &amp; <i>pt</i> ) const</h3>
<p>Returns the <a href="qaction.html">QAction</a> at <i>pt</i>. Returns 0 if there is no action at <i>pt</i> or if the location has a separator.</p>
<p><b>See also </b><a href="qmenubar.html#addAction">addAction</a>() and <a href="qmenubar.html#addSeparator">addSeparator</a>().</p>
<!-- @@@actionAt -->
<!-- $$$actionEvent[overload1]$$$actionEventQActionEvent* -->
<h3 class="fn"><a name="actionEvent"></a><span class="type">void</span> QMenuBar::<span class="name">actionEvent</span> ( <span class="type"><a href="qactionevent.html">QActionEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#actionEvent">QWidget::actionEvent</a>().</p>
<!-- @@@actionEvent -->
<!-- $$$actionGeometry[overload1]$$$actionGeometryQAction* -->
<h3 class="fn"><a name="actionGeometry"></a><span class="type"><a href="qrect.html">QRect</a></span> QMenuBar::<span class="name">actionGeometry</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>act</i> ) const</h3>
<p>Returns the geometry of action <i>act</i> as a <a href="qrect.html">QRect</a>.</p>
<p><b>See also </b><a href="qmenubar.html#actionAt">actionAt</a>().</p>
<!-- @@@actionGeometry -->
<!-- $$$activeAction[overload1]$$$activeAction -->
<h3 class="fn"><a name="activeAction"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">activeAction</span> () const</h3>
<p>Returns the <a href="qaction.html">QAction</a> that is currently highlighted. A null pointer will be returned if no action is currently selected.</p>
<p><b>See also </b><a href="qmenubar.html#setActiveAction">setActiveAction</a>().</p>
<!-- @@@activeAction -->
<!-- $$$addAction[overload1]$$$addActionconstQString& -->
<h3 class="fn"><a name="addAction"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">addAction</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i> )</h3>
<p>This is an overloaded function.</p>
<p>This convenience function creates a new action with <i>text</i>. The function adds the newly created action to the menu's list of actions, and returns it.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qwidget.html#actions">QWidget::actions</a>().</p>
<!-- @@@addAction -->
<!-- $$$addAction$$$addActionconstQString&constQObject*constchar* -->
<h3 class="fn"><a name="addAction-2"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">addAction</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>text</i>, const <span class="type"><a href="qobject.html">QObject</a></span> * <i>receiver</i>, const <span class="type">char</span> * <i>member</i> )</h3>
<p>This is an overloaded function.</p>
<p>This convenience function creates a new action with the given <i>text</i>. The action's <a href="qmenubar.html#triggered">triggered</a>() signal is connected to the <i>receiver</i>'s <i>member</i> slot. The function adds the newly created action to the menu's list of actions and returns it.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qwidget.html#actions">QWidget::actions</a>().</p>
<!-- @@@addAction -->
<!-- $$$addAction$$$addActionQAction* -->
<h3 class="fn"><a name="addAction-3"></a><span class="type">void</span> QMenuBar::<span class="name">addAction</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>action</i> )</h3>
<p>This is an overloaded function.</p>
<p>Appends the action <i>action</i> to the menu bar's list of actions.</p>
<p><b>See also </b><a href="qmenu.html#addAction">QMenu::addAction</a>(), <a href="qwidget.html#addAction">QWidget::addAction</a>(), and <a href="qwidget.html#actions">QWidget::actions</a>().</p>
<!-- @@@addAction -->
<!-- $$$addMenu[overload1]$$$addMenuQMenu* -->
<h3 class="fn"><a name="addMenu"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">addMenu</span> ( <span class="type"><a href="qmenu.html">QMenu</a></span> * <i>menu</i> )</h3>
<p>Appends <i>menu</i> to the menu bar. Returns the menu's menuAction().</p>
<p><b>Note:</b> The returned <a href="qaction.html">QAction</a> object can be used to hide the corresponding menu.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qmenu.html#menuAction">QMenu::menuAction</a>().</p>
<!-- @@@addMenu -->
<!-- $$$addMenu$$$addMenuconstQString& -->
<h3 class="fn"><a name="addMenu-2"></a><span class="type"><a href="qmenu.html">QMenu</a></span> * QMenuBar::<span class="name">addMenu</span> ( const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>title</i> )</h3>
<p>Appends a new <a href="qmenu.html">QMenu</a> with <i>title</i> to the menu bar. The menu bar takes ownership of the menu. Returns the new menu.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qmenu.html#menuAction">QMenu::menuAction</a>().</p>
<!-- @@@addMenu -->
<!-- $$$addMenu$$$addMenuconstQIcon&constQString& -->
<h3 class="fn"><a name="addMenu-3"></a><span class="type"><a href="qmenu.html">QMenu</a></span> * QMenuBar::<span class="name">addMenu</span> ( const <span class="type"><a href="qicon.html">QIcon</a></span> &amp; <i>icon</i>, const <span class="type"><a href="qstring.html">QString</a></span> &amp; <i>title</i> )</h3>
<p>Appends a new <a href="qmenu.html">QMenu</a> with <i>icon</i> and <i>title</i> to the menu bar. The menu bar takes ownership of the menu. Returns the new menu.</p>
<p><b>See also </b><a href="qwidget.html#addAction">QWidget::addAction</a>() and <a href="qmenu.html#menuAction">QMenu::menuAction</a>().</p>
<!-- @@@addMenu -->
<!-- $$$addSeparator[overload1]$$$addSeparator -->
<h3 class="fn"><a name="addSeparator"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">addSeparator</span> ()</h3>
<p>Appends a separator to the menu.</p>
<!-- @@@addSeparator -->
<!-- $$$changeEvent[overload1]$$$changeEventQEvent* -->
<h3 class="fn"><a name="changeEvent"></a><span class="type">void</span> QMenuBar::<span class="name">changeEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#changeEvent">QWidget::changeEvent</a>().</p>
<!-- @@@changeEvent -->
<!-- $$$clear[overload1]$$$clear -->
<h3 class="fn"><a name="clear"></a><span class="type">void</span> QMenuBar::<span class="name">clear</span> ()</h3>
<p>Removes all the actions from the menu bar.</p>
<p><b>Note:</b> On Mac OS X, menu items that have been merged to the system menu bar are not removed by this function. One way to handle this would be to remove the extra actions yourself. You can set the <a href="qaction.html#MenuRole-enum">menu role</a> on the different menus, so that you know ahead of time which menu items get merged and which do not. Then decide what to recreate or remove yourself.</p>
<p><b>See also </b><a href="qwidget.html#removeAction">removeAction</a>().</p>
<!-- @@@clear -->
<!-- $$$cornerWidget[overload1]$$$cornerWidgetQt::Corner -->
<h3 class="fn"><a name="cornerWidget"></a><span class="type"><a href="qwidget.html">QWidget</a></span> * QMenuBar::<span class="name">cornerWidget</span> ( <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i> = Qt::TopRightCorner ) const</h3>
<p>Returns the widget on the left of the first or on the right of the last menu item, depending on <i>corner</i>.</p>
<p><b>Note:</b> Using a corner other than <a href="qt.html#Corner-enum">Qt::TopRightCorner</a> or <a href="qt.html#Corner-enum">Qt::TopLeftCorner</a> will result in a warning.</p>
<p><b>See also </b><a href="qmenubar.html#setCornerWidget">setCornerWidget</a>().</p>
<!-- @@@cornerWidget -->
<!-- $$$defaultAction[overload1]$$$defaultAction -->
<h3 class="fn"><a name="defaultAction"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">defaultAction</span> () const</h3>
<p>Returns the current default action.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qmenubar.html#setDefaultAction">setDefaultAction</a>().</p>
<!-- @@@defaultAction -->
<!-- $$$event[overload1]$$$eventQEvent* -->
<h3 class="fn"><a name="event"></a><span class="type">bool</span> QMenuBar::<span class="name">event</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#event">QObject::event</a>().</p>
<!-- @@@event -->
<!-- $$$eventFilter[overload1]$$$eventFilterQObject*QEvent* -->
<h3 class="fn"><a name="eventFilter"></a><span class="type">bool</span> QMenuBar::<span class="name">eventFilter</span> ( <span class="type"><a href="qobject.html">QObject</a></span> * <i>object</i>, <span class="type"><a href="qevent.html">QEvent</a></span> * <i>event</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#eventFilter">QObject::eventFilter</a>().</p>
<!-- @@@eventFilter -->
<!-- $$$focusInEvent[overload1]$$$focusInEventQFocusEvent* -->
<h3 class="fn"><a name="focusInEvent"></a><span class="type">void</span> QMenuBar::<span class="name">focusInEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusInEvent">QWidget::focusInEvent</a>().</p>
<!-- @@@focusInEvent -->
<!-- $$$focusOutEvent[overload1]$$$focusOutEventQFocusEvent* -->
<h3 class="fn"><a name="focusOutEvent"></a><span class="type">void</span> QMenuBar::<span class="name">focusOutEvent</span> ( <span class="type"><a href="qfocusevent.html">QFocusEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#focusOutEvent">QWidget::focusOutEvent</a>().</p>
<!-- @@@focusOutEvent -->
<!-- $$$heightForWidth[overload1]$$$heightForWidthint -->
<h3 class="fn"><a name="heightForWidth"></a><span class="type">int</span> QMenuBar::<span class="name">heightForWidth</span> ( <span class="type">int</span> ) const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#heightForWidth">QWidget::heightForWidth</a>().</p>
<!-- @@@heightForWidth -->
<!-- $$$hovered[overload1]$$$hoveredQAction* -->
<h3 class="fn"><a name="hovered"></a><span class="type">void</span> QMenuBar::<span class="name">hovered</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>action</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when a menu action is highlighted; <i>action</i> is the action that caused the event to be sent.</p>
<p>Often this is used to update status information.</p>
<p><b>See also </b><a href="qmenubar.html#triggered">triggered</a>() and <a href="qaction.html#hovered">QAction::hovered</a>().</p>
<!-- @@@hovered -->
<!-- $$$initStyleOption[overload1]$$$initStyleOptionQStyleOptionMenuItem*constQAction* -->
<h3 class="fn"><a name="initStyleOption"></a><span class="type">void</span> QMenuBar::<span class="name">initStyleOption</span> ( <span class="type"><a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a></span> * <i>option</i>, const <span class="type"><a href="qaction.html">QAction</a></span> * <i>action</i> ) const<tt> [protected]</tt></h3>
<p>Initialize <i>option</i> with the values from the menu bar and information from <i>action</i>. This method is useful for subclasses when they need a <a href="qstyleoptionmenuitem.html">QStyleOptionMenuItem</a>, but don't want to fill in all the information themselves.</p>
<p><b>See also </b><a href="qstyleoption.html#initFrom">QStyleOption::initFrom</a>() and <a href="qmenu.html#initStyleOption">QMenu::initStyleOption</a>().</p>
<!-- @@@initStyleOption -->
<!-- $$$insertMenu[overload1]$$$insertMenuQAction*QMenu* -->
<h3 class="fn"><a name="insertMenu"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">insertMenu</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>before</i>, <span class="type"><a href="qmenu.html">QMenu</a></span> * <i>menu</i> )</h3>
<p>This convenience function inserts <i>menu</i> before action <i>before</i> and returns the menus menuAction().</p>
<p><b>See also </b><a href="qwidget.html#insertAction">QWidget::insertAction</a>() and <a href="qmenubar.html#addMenu">addMenu</a>().</p>
<!-- @@@insertMenu -->
<!-- $$$insertSeparator[overload1]$$$insertSeparatorQAction* -->
<h3 class="fn"><a name="insertSeparator"></a><span class="type"><a href="qaction.html">QAction</a></span> * QMenuBar::<span class="name">insertSeparator</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>before</i> )</h3>
<p>This convenience function creates a new separator action, i.e&#x2e; an action with <a href="qaction.html#isSeparator">QAction::isSeparator</a>() returning true. The function inserts the newly created action into this menu bar's list of actions before action <i>before</i> and returns it.</p>
<p><b>See also </b><a href="qwidget.html#insertAction">QWidget::insertAction</a>() and <a href="qmenubar.html#addSeparator">addSeparator</a>().</p>
<!-- @@@insertSeparator -->
<!-- $$$keyPressEvent[overload1]$$$keyPressEventQKeyEvent* -->
<h3 class="fn"><a name="keyPressEvent"></a><span class="type">void</span> QMenuBar::<span class="name">keyPressEvent</span> ( <span class="type"><a href="qkeyevent.html">QKeyEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#keyPressEvent">QWidget::keyPressEvent</a>().</p>
<!-- @@@keyPressEvent -->
<!-- $$$leaveEvent[overload1]$$$leaveEventQEvent* -->
<h3 class="fn"><a name="leaveEvent"></a><span class="type">void</span> QMenuBar::<span class="name">leaveEvent</span> ( <span class="type"><a href="qevent.html">QEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#leaveEvent">QWidget::leaveEvent</a>().</p>
<!-- @@@leaveEvent -->
<!-- $$$minimumSizeHint[overload1]$$$minimumSizeHint -->
<h3 class="fn"><a name="minimumSizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QMenuBar::<span class="name">minimumSizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#minimumSizeHint-prop">QWidget::minimumSizeHint</a>().</p>
<!-- @@@minimumSizeHint -->
<!-- $$$mouseMoveEvent[overload1]$$$mouseMoveEventQMouseEvent* -->
<h3 class="fn"><a name="mouseMoveEvent"></a><span class="type">void</span> QMenuBar::<span class="name">mouseMoveEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseMoveEvent">QWidget::mouseMoveEvent</a>().</p>
<!-- @@@mouseMoveEvent -->
<!-- $$$mousePressEvent[overload1]$$$mousePressEventQMouseEvent* -->
<h3 class="fn"><a name="mousePressEvent"></a><span class="type">void</span> QMenuBar::<span class="name">mousePressEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mousePressEvent">QWidget::mousePressEvent</a>().</p>
<!-- @@@mousePressEvent -->
<!-- $$$mouseReleaseEvent[overload1]$$$mouseReleaseEventQMouseEvent* -->
<h3 class="fn"><a name="mouseReleaseEvent"></a><span class="type">void</span> QMenuBar::<span class="name">mouseReleaseEvent</span> ( <span class="type"><a href="qmouseevent.html">QMouseEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#mouseReleaseEvent">QWidget::mouseReleaseEvent</a>().</p>
<!-- @@@mouseReleaseEvent -->
<!-- $$$paintEvent[overload1]$$$paintEventQPaintEvent* -->
<h3 class="fn"><a name="paintEvent"></a><span class="type">void</span> QMenuBar::<span class="name">paintEvent</span> ( <span class="type"><a href="qpaintevent.html">QPaintEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#paintEvent">QWidget::paintEvent</a>().</p>
<!-- @@@paintEvent -->
<!-- $$$resizeEvent[overload1]$$$resizeEventQResizeEvent* -->
<h3 class="fn"><a name="resizeEvent"></a><span class="type">void</span> QMenuBar::<span class="name">resizeEvent</span> ( <span class="type"><a href="qresizeevent.html">QResizeEvent</a></span> * )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#resizeEvent">QWidget::resizeEvent</a>().</p>
<!-- @@@resizeEvent -->
<!-- $$$setActiveAction[overload1]$$$setActiveActionQAction* -->
<h3 class="fn"><a name="setActiveAction"></a><span class="type">void</span> QMenuBar::<span class="name">setActiveAction</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>act</i> )</h3>
<p>Sets the currently highlighted action to <i>act</i>.</p>
<p>This function was introduced in Qt 4.1.</p>
<p><b>See also </b><a href="qmenubar.html#activeAction">activeAction</a>().</p>
<!-- @@@setActiveAction -->
<!-- $$$setCornerWidget[overload1]$$$setCornerWidgetQWidget*Qt::Corner -->
<h3 class="fn"><a name="setCornerWidget"></a><span class="type">void</span> QMenuBar::<span class="name">setCornerWidget</span> ( <span class="type"><a href="qwidget.html">QWidget</a></span> * <i>widget</i>, <span class="type"><a href="qt.html#Corner-enum">Qt::Corner</a></span> <i>corner</i> = Qt::TopRightCorner )</h3>
<p>This sets the given <i>widget</i> to be shown directly on the left of the first menu item, or on the right of the last menu item, depending on <i>corner</i>.</p>
<p>The menu bar takes ownership of <i>widget</i>, reparenting it into the menu bar. However, if the <i>corner</i> already contains a widget, this previous widget will no longer be managed and will still be a visible child of the menu bar.</p>
<p><b>Note:</b> Using a corner other than <a href="qt.html#Corner-enum">Qt::TopRightCorner</a> or <a href="qt.html#Corner-enum">Qt::TopLeftCorner</a> will result in a warning.</p>
<p><b>See also </b><a href="qmenubar.html#cornerWidget">cornerWidget</a>().</p>
<!-- @@@setCornerWidget -->
<!-- $$$setDefaultAction[overload1]$$$setDefaultActionQAction* -->
<h3 class="fn"><a name="setDefaultAction"></a><span class="type">void</span> QMenuBar::<span class="name">setDefaultAction</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>act</i> )</h3>
<p>Sets the default action to <i>act</i>.</p>
<p>The default action is assigned to the left soft key. The menu is assigned to the right soft key.</p>
<p>Currently there is only support for the default action on Windows Mobile. On all other platforms this method is not available.</p>
<p>This function was introduced in Qt 4.4.</p>
<p><b>See also </b><a href="qmenubar.html#defaultAction">defaultAction</a>().</p>
<!-- @@@setDefaultAction -->
<!-- $$$setVisible[overload1]$$$setVisiblebool -->
<h3 class="fn"><a name="setVisible"></a><span class="type">void</span> QMenuBar::<span class="name">setVisible</span> ( <span class="type">bool</span> <i>visible</i> )<tt> [virtual slot]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#visible-prop">QWidget::setVisible</a>().</p>
<!-- @@@setVisible -->
<!-- $$$sizeHint[overload1]$$$sizeHint -->
<h3 class="fn"><a name="sizeHint"></a><span class="type"><a href="qsize.html">QSize</a></span> QMenuBar::<span class="name">sizeHint</span> () const<tt> [virtual]</tt></h3>
<p>Reimplemented from <a href="qwidget.html#sizeHint-prop">QWidget::sizeHint</a>().</p>
<!-- @@@sizeHint -->
<!-- $$$timerEvent[overload1]$$$timerEventQTimerEvent* -->
<h3 class="fn"><a name="timerEvent"></a><span class="type">void</span> QMenuBar::<span class="name">timerEvent</span> ( <span class="type"><a href="qtimerevent.html">QTimerEvent</a></span> * <i>e</i> )<tt> [virtual protected]</tt></h3>
<p>Reimplemented from <a href="qobject.html#timerEvent">QObject::timerEvent</a>().</p>
<!-- @@@timerEvent -->
<!-- $$$triggered[overload1]$$$triggeredQAction* -->
<h3 class="fn"><a name="triggered"></a><span class="type">void</span> QMenuBar::<span class="name">triggered</span> ( <span class="type"><a href="qaction.html">QAction</a></span> * <i>action</i> )<tt> [signal]</tt></h3>
<p>This signal is emitted when an action in a menu belonging to this menubar is triggered as a result of a mouse click; <i>action</i> is the action that caused the signal to be emitted.</p>
<p><b>Note:</b> <a href="qmenubar.html">QMenuBar</a> has to have ownership of the <a href="qmenu.html">QMenu</a> in order this signal to work.</p>
<p>Normally, you connect each menu action to a single slot using <a href="qaction.html#triggered">QAction::triggered</a>(), but sometimes you will want to connect several items to a single slot (most often if the user selects from an array). This signal is useful in such cases.</p>
<p><b>See also </b><a href="qmenubar.html#hovered">hovered</a>() and <a href="qaction.html#triggered">QAction::triggered</a>().</p>
<!-- @@@triggered -->
</div>
      </div>
    </div>
    </div> 
    <div class="ft">
      <span></span>
    </div>
  </div> 
  <div class="footer">
    <p>
      <acronym title="Copyright">&copy;</acronym> 2013 Digia Plc and/or its
      subsidiaries. Documentation contributions included herein are the copyrights of
      their respective owners.</p>
    <br />
    <p>
      The documentation provided herein is licensed under the terms of the
      <a href="http://www.gnu.org/licenses/fdl.html">GNU Free Documentation
      License version 1.3</a> as published by the Free Software Foundation.</p>
    <p>
      Documentation sources may be obtained from <a href="http://www.qt-project.org">
      www.qt-project.org</a>.</p>
    <br />
    <p>
      Digia, Qt and their respective logos are trademarks of Digia Plc 
      in Finland and/or other countries worldwide. All other trademarks are property
      of their respective owners. <a title="Privacy Policy"
      href="http://en.gitorious.org/privacy_policy/">Privacy Policy</a></p>
  </div>

  <script src="scripts/functions.js" type="text/javascript"></script>
</body>
</html>