⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 qmenubar.html

📁 QT 下载资料仅供参考
💻 HTML
📖 第 1 页 / 共 3 页
字号:
<p> To look best when being highlighted as a menu item, the pixmap shouldprovide a mask (see <a href="qpixmap.html#mask">QPixmap::mask</a>()).<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>().<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts a menu item with icon <em>icon</em>, pixmap <em>pixmap</em>,optional id <em>id</em>, and optional <em>index</em>.The icon will be displayed to the left of the pixmap in the item.<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>().<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts a menu item with pixmap <em>pixmap</em>, submenu <em>popup</em>,optional id <em>id</em>, and optional <em>index</em>.<p> The <em>popup</em> must be deleted by the programmer or by its parentwidget.  It is not deleted when this menu item is removed or whenthe menu is deleted.<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>().<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<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>.The icon will be displayed to the left of the pixmap in the item.<p> The <em>popup</em> must be deleted by the programmer or by its parentwidget.  It is not deleted when this menu item is removed or whenthe menu is deleted.<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>().<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts a menu item that consists of the widget <em>widget</em> withoptional id <em>id</em>, and optional <em>index</em>.<p> Ownership of <em>widget</em> is transferred to the popup menu or to themenu bar.<p> Theoretically, any widget can be inserted into a popup menu. Inpractice, this only makes sense with certain widgets.<p> If a widget is not focus-enabled (see <a href="qwidget.html#isFocusEnabled">QWidget::isFocusEnabled</a>()),the menu treats it as a separator; this means that the item is notselectable and will never get focus. In this way you can, for example,simply insert a <a href="qlabel.html">QLabel</a> if you need a popup menu with a title.<p> If the widget is focus-enabled it will get focus when the usertraverses the popup menu with the arrow keys. If the widget does notaccept ArrowUp and ArrowDown in its key event handler, the focuswill move back to the menu when the respective arrow key is hitone more time. This works with a <a href="qlineedit.html">QLineEdit</a>, for example.  If thewidget accepts the arrow key itself, it must also provide thepossibility to put the focus back on the menu again by calling<a href="qwidget.html#focusNextPrevChild">QWidget::focusNextPrevChild</a>(). Futhermore, if theembedded widget closes the menu when the user made a selection, thiscan be done safely by calling<pre>    if ( <a href="qwidget.html#isVisible">isVisible</a>() &amp;&amp;         <a href="qwidget.html#parentWidget">parentWidget</a>() &amp;&amp;         <a href="qwidget.html#parentWidget">parentWidget</a>()-&gt;inherits("QPopupMenu") )        <a href="qwidget.html#parentWidget">parentWidget</a>()-&gt;close();  </pre> <p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<p> <p>See also <a href="qmenudata.html#removeItem">removeItem</a>().<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts a custom menu item <em>custom</em> with an <em>icon</em> and withoptional id <em>id</em>, and optional <em>index</em>.<p> This only works with popup menus. It is not supported for menu bars.Ownership of <em>custom</em> is transferred to the popup menu.<p> If you want to connect a custom item to a certain slot, use <a href="qmenudata.html#connectItem">connectItem</a>().<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>.<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 )</h3>This is an overloaded member function, provided for convenience. It behaves essentially like the above function.<p> Inserts a custom menu item <em>custom</em> withoptional id <em>id</em>, and optional <em>index</em>.<p> This only works with popup menus. It is not supported for menu bars.Ownership of <em>custom</em> is transferred to the popup menu.<p> If you want to connect a custom item to a certain slot, use <a href="qmenudata.html#connectItem">connectItem</a>().<p> Returns the allocated <a href="qmenudata.html#menu-identifier">menu identifier</a> number (<em>id</em> if <em>id</em> >= 0).<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>.<h3 class=fn>int <a name="insertSeparator"></a>QMenuData::insertSeparator ( int&nbsp;index = -1 )</h3>Inserts a separator at position <em>index</em>.The separator becomes the last menu item if <em>index</em> is negative.<p> In a popup menu a separator is rendered as a horizontal line.  In aMotif menu bar a separator is spacing, so the rest of the items(normally just "Help") are drawn right-justified.  In a Windowsmenu bar separators are ignored (to comply with the Windows styleguidelines).<p>Examples: <a href="addressbook-example.html#x519">addressbook/mainwindow.cpp</a>, <a href="mdi-example.html#x2014">mdi/application.cpp</a>, <a href="menu-example.html#x1861">menu/menu.cpp</a>, <a href="progress-example.html#x37">progress/progress.cpp</a>, <a href="scrollview-example.html#x722">scrollview/scrollview.cpp</a>, <a href="showimg-example.html#x1266">showimg/showimg.cpp</a> and <a href="sound-example.html#x2658">sound/sound.cpp</a>.<h3 class=fn>bool <a name="isDefaultUp"></a>QMenuBar::isDefaultUp () const</h3><p>Returns the popup orientation.See the <a href="qmenubar.html#defaultUp-prop">"defaultUp"</a> property for details.<h3 class=fn>bool <a name="isItemEnabled"></a>QMenuData::isItemEnabled ( int&nbsp;id ) const</h3>Returns TRUE if the item with identifier <em>id</em> is enabled; otherwisereturns FALSE<p>See also <a href="qmenudata.html#setItemEnabled">setItemEnabled</a>().<h3 class=fn>void <a name="menuContentsChanged"></a>QMenuBar::menuContentsChanged ()<tt> [virtual protected]</tt></h3>Recomputes the menu bar's display data according to the newcontents.<p> You should never need to call this; it is called automatically by<a href="qmenudata.html">QMenuData</a> whenever it needs to be called.<p>Reimplemented from <a href="qmenudata.html#menuContentsChanged">QMenuData</a>.<h3 class=fn>void <a name="menuStateChanged"></a>QMenuBar::menuStateChanged ()<tt> [virtual protected]</tt></h3>Recomputes the menu bar's display data according to the newstate.<p> You should never need to call this; it is called automatically by<a href="qmenudata.html">QMenuData</a> whenever it needs to be called.<p>Reimplemented from <a href="qmenudata.html#menuStateChanged">QMenuData</a>.<h3 class=fn>void <a name="removeItem"></a>QMenuData::removeItem ( int&nbsp;id )</h3>Removes the menu item that has the identifier <em>id</em>.<p>See also <a href="qmenudata.html#removeItemAt">removeItemAt</a>() and <a href="qmenudata.html#clear">clear</a>().<p>Example: <a href="canvas-chart-example.html#x2602">chart/chartform.cpp</a>.<h3 class=fn><a href="qmenubar.html#Separator-enum">Separator</a> <a name="separator"></a>QMenuBar::separator () const</h3><p>Returns in which cases a menubar sparator is drawn.See the <a href="qmenubar.html#separator-prop">"separator"</a> property for details.<h3 class=fn>void <a name="setDefaultUp"></a>QMenuBar::setDefaultUp ( bool )</h3><p>Sets the popup orientation.See the <a href="qmenubar.html#defaultUp-prop">"defaultUp"</a> property for details.<h3 class=fn>void <a name="setItemEnabled"></a>QMenuData::setItemEnabled ( int&nbsp;id, bool&nbsp;enable )</h3>If <em>enable</em> is TRUE, enables the menu item with identifier <em>id</em>;otherwise disables the menu item with identifier <em>id</em>.<p>See also <a href="qmenudata.html#isItemEnabled">isItemEnabled</a>().<p>Examples: <a href="mdi-example.html#x2016">mdi/application.cpp</a>, <a href="menu-example.html#x1864">menu/menu.cpp</a>, <a href="progress-example.html#x40">progress/progress.cpp</a> and <a href="showimg-example.html#x1269">showimg/showimg.cpp</a>.<h3 class=fn>void <a name="setSeparator"></a>QMenuBar::setSeparator ( <a href="qmenubar.html#Separator-enum">Separator</a>&nbsp;when )<tt> [virtual]</tt></h3><p>Sets in which cases a menubar sparator is drawn to <em>when</em>.See the <a href="qmenubar.html#separator-prop">"separator"</a> property for details.<h3 class=fn>void <a name="show"></a>QMenuBar::show ()<tt> [virtual]</tt></h3>Reimplements <a href="qwidget.html#show">QWidget::show</a>() in order to set up the correct keyboardaccelerators and to raise itself to the top of the widget stack.<p>Example: <a href="grapher-nsplugin-example.html#x2754">grapher/grapher.cpp</a>.<p>Reimplemented from <a href="qwidget.html#show">QWidget</a>.<hr><h2>Property Documentation</h2><h3 class=fn>bool <a name="defaultUp-prop"></a>defaultUp</h3><p>This property holds the popup orientation.<p>The default popup orientation. By default, menus pop "down" thescreen.  By setting the property to TRUE, the menu will pop "up".  Youmight call this for menus that are <em>below</em> the document to whichthey refer.<p> If the menu would not fit on the screen, the other direction is usedrather than the default.<p>Set this property's value with <a href="#setDefaultUp">setDefaultUp</a>() and get this property's value with <a href="#isDefaultUp">isDefaultUp</a>().<h3 class=fn><a href="qmenubar.html#Separator-enum">Separator</a> <a name="separator-prop"></a>separator</h3><p>This property holds in which cases a menubar sparator is drawn.<p><b>This property is obsolete.</b> It is provided to keep old source working. We strongly advise against using it in new code.<p> <p>Set this property's value with <a href="#setSeparator">setSeparator</a>() and get this property's value with <a href="#separator">separator</a>().<!-- eof --><hr><p>This file is part of the <a href="index.html">Qt toolkit</a>.Copyright &copy; 1995-2002<a href="http://www.trolltech.com/">Trolltech</a>. All Rights Reserved.<p><address><hr><div align=center><table width=100% cellspacing=0 border=0><tr><td>Copyright &copy; 2002 <a href="http://www.trolltech.com">Trolltech</a><td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a><td align=right><div align=right>Qt version 3.0.5</div></table></div></address></body></html>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -