📄 qmenubar.3qt
字号:
.TH QMenuBar 3qt "6 July 1999" "Troll Tech AS" \" -*- nroff -*-.\" Copyright 1992-1999 Troll Tech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQMenuBar \- Horizontal menu bar.SH SYNOPSIS.br.PP\fC#include <qmenubar.h>\fR.PPInherits QFrame and QMenuData..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQMenuBar\fR ( QWidget * " "parent" "=0, const char * " "name" "=0 )".br.ti -1c.BI "\fB~QMenuBar\fR ()".br.ti -1c.BI "virtual void \fBupdateItem\fR ( int id )".br.ti -1c.BI "virtual void \fBshow\fR ()".br.ti -1c.BI "virtual void \fBhide\fR ()".br.ti -1c.BI "virtual bool \fBeventFilter\fR ( QObject *, QEvent * )".br.ti -1c.BI "virtual int \fBheightForWidth\fR ( int ) const".br.ti -1c.BI "enum \fBSeparator\fR { Never=0, InWindowsStyle=1 }".br.ti -1c.BI "Separator \fBseparator\fR () const".br.ti -1c.BI "virtual void \fBsetSeparator\fR ( Separator when )".br.ti -1c.BI "virtual bool \fBcustomWhatsThis\fR () const".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBactivated\fR ( int itemId )".br.ti -1c.BI "void \fBhighlighted\fR ( int itemId )".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBdrawContents\fR ( QPainter * )".br.ti -1c.BI "virtual void \fBfontChange\fR ( const QFont & )".br.ti -1c.BI "virtual void \fBmousePressEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBmouseReleaseEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBmouseMoveEvent\fR ( QMouseEvent * )".br.ti -1c.BI "virtual void \fBkeyPressEvent\fR ( QKeyEvent * )".br.ti -1c.BI "virtual void \fBfocusOutEvent\fR ( QFocusEvent * )".br.ti -1c.BI "virtual void \fBresizeEvent\fR ( QResizeEvent * )".br.ti -1c.BI "virtual void \fBleaveEvent\fR ( QEvent * )".br.ti -1c.BI "virtual void \fBmenuContentsChanged\fR ()".br.ti -1c.BI "virtual void \fBmenuStateChanged\fR ()".br.ti -1c.BI "virtual void \fBstyleChange\fR ( QStyle & )".br.in -1c.SH DESCRIPTIONThe QMenuBar class provides a horizontal menu bar..PPIt automatically sets its own geometry to the top of the parent widget and changes appropriately it when the parent widget is resized..PPmenu/menu.cpp is a typical example of QMenuBar and QPopupMenu use..PP<img src=qmenubar-m.png> <img src=qmenubar-w.png>.PPSee also: QPopupMenu and GUI Design Handbook: Menu Bar.PPExamples:.(lgrapher/grapher.cpp layout/layout.cpp menu/menu.cpp progress/progress.cpp scrollview/scrollview.cpp.)l.SS "Member Type Documentation".SH "QMenuBar::Separator"This enum type is used to decide whether QMenuBar should draw a separator line at its bottom. The possible values are: .IP.TP\fCNever\fR - in many applications, there already is a separator, and two looks stupid..IP.TP\fCInWindowsStyle\fR - in some other applications, a separator looks good in Windows style but not else..IP.SH MEMBER FUNCTION DOCUMENTATION.SH "<a name="31d9d4">QMenuBar::QMenuBar ( QWidget * parent=0, const char * name=0 )"Creates a menu bar with a \fIparent\fR and a \fIname.\fR.SH "QMenuBar::~QMenuBar ()"Destroys the menu bar..SH "void QMenuBar::activated ( int id ) \fC[signal]\fR"This signal is emitted when a menu item is selected; \fIid\fR is the id of the selected item..PPNormally, you will connect each menu item to a single slot using QMenuData::insertItem(), 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 handy in such cases..PPSee also: highlighted() and QMenuData::insertItem()..SH "bool QMenuBar::customWhatsThis () const \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMenuBar::drawContents ( QPainter * p ) \fC[virtual protected]\fR"Called from QFrame::paintEvent()..PPReimplemented from QFrame..SH "bool QMenuBar::eventFilter ( QObject * object, QEvent * event ) \fC[virtual]\fR"This function is used to adjust the menu bar's geometry to the parent widget's. Note that this is \fInot\fR part of the public interface - the function is \fCpublic\fR only because QObject::eventFilter() is..PPReimplemented from QObject..SH "void QMenuBar::focusOutEvent ( QFocusEvent * e ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMenuBar::fontChange ( const QFont & f ) \fC[virtual protected]\fR"For internal use only..PPReimplemented from QWidget..SH "int QMenuBar::heightForWidth ( int max_width ) const \fC[virtual]\fR"Returns the height that the menu would resize itself to if its parent (and hence itself) resized to the given width. This can be useful for simple layout tasks where the height of the menubar is needed after items have been inserted. See examples/showimg/showimg.cpp for an example of the usage..PPReimplemented from QWidget..SH "void QMenuBar::hide () \fC[virtual]\fR"Reimplements QWidget::hide() in order to deselect any selected item..PPExamples:.(lgrapher/grapher.cpp.)l.PPReimplemented from QWidget..SH "void QMenuBar::highlighted ( int id ) \fC[signal]\fR"This signal is emitted when a menu item is highlighted; \fIid\fR is the id of the highlighted item..PPNormally, you will connect each menu item to a single slot using QMenuData::insertItem(), 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 handy in such cases..PPSee also: activated() and QMenuData::insertItem()..SH "void QMenuBar::keyPressEvent ( QKeyEvent * e ) \fC[virtual protected]\fR"Handles key press events for the menu bar..PPReimplemented from QWidget..SH "void QMenuBar::leaveEvent ( QEvent * e ) \fC[virtual protected]\fR"Handles leave events for the menu bar..PPReimplemented from QWidget..SH "void QMenuBar::menuContentsChanged () \fC[virtual protected]\fR"Recomputes the menu bar's display data according to the new contents..PPYou should never need to call this, it is called automatically by QMenuData whenever it needs to be called..PPReimplemented from QMenuData..SH "void QMenuBar::menuStateChanged () \fC[virtual protected]\fR"Recomputes the menu bar's display data according to the new state..PPYou should never need to call this, it is called automatically by QMenuData whenever it needs to be called..PPReimplemented from QMenuData..SH "void QMenuBar::mouseMoveEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse move events for the menu bar..PPReimplemented from QWidget..SH "void QMenuBar::mousePressEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse press events for the menu bar..PPReimplemented from QWidget..SH "void QMenuBar::mouseReleaseEvent ( QMouseEvent * e ) \fC[virtual protected]\fR"Handles mouse release events for the menu bar..PPReimplemented from QWidget..SH "void QMenuBar::resizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"Handles resize events for the menu bar..PPReimplemented from QWidget..SH "QMenuBar::Separator QMenuBar::separator() const"Returns the currently set Separator usage..PPSee also: Separator and setSeparator()..SH "void QMenuBar::setSeparator ( Separator when ) \fC[virtual]\fR"When a menubar is used above an unframed widget, it may look better with a separating line when displayed with WindowsStyle..PPThis function sets the usage of such a separator to appear either QMenuBar::Never, or QMenuBar::InWindowsStyle..PPThe default is QMenuBar::Never..PPSee also: Separator and separator()..PPExamples:.(llayout/layout.cpp scrollview/scrollview.cpp.)l.SH "void QMenuBar::show () \fC[virtual]\fR"Reimplements QWidget::show() in order to set up the correct keyboard accelerators and raise itself to the top of the widget stack..PPExamples:.(lgrapher/grapher.cpp.)l.PPReimplemented from QWidget..SH "void QMenuBar::styleChange ( QStyle & old ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMenuBar::updateItem ( int ) \fC[virtual]\fR"For internal use only..PPReimplemented from QMenuData..SH "SEE ALSO".BR http://www.troll.no/qt/qmenubar.html.SH COPYRIGHTCopyright 1992-1999 Troll Tech AS. See the license file included inthe distribution for a complete license statement..SH AUTHORGenerated automatically from the source code.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -