qmainwindow.3qt

来自「tmark1.11:用于生成QT/EMBEDDED应用工程的Markfile文件」· 3QT 代码 · 共 292 行

3QT
292
字号
.TH QMainWindow 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 NAMEQMainWindow \- Typical application window, with a menu bar, some tool bars and a status bar.SH SYNOPSIS.br.PP\fC#include <qmainwindow.h>\fR.PPInherits QWidget..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQMainWindow\fR ( QWidget * " "parent" " = 0, const char * " "name" " = 0, WFlags " "f" " = WType_TopLevel )".br.ti -1c.BI "\fB~QMainWindow\fR ()".br.ti -1c.BI "QMenuBar* \fBmenuBar\fR () const".br.ti -1c.BI "QStatusBar* \fBstatusBar\fR () const".br.ti -1c.BI "QToolTipGroup* \fBtoolTipGroup\fR () const".br.ti -1c.BI "virtual void \fBsetCentralWidget\fR ( QWidget * )".br.ti -1c.BI "QWidget* \fBcentralWidget\fR () const".br.ti -1c.BI "enum \fBToolBarDock\fR { Unmanaged, TornOff, Top, Bottom, Right, Left }".br.ti -1c.BI "virtual void \fBsetDockEnabled\fR ( ToolBarDock " "dock" ", bool enable )".br.ti -1c.BI "bool \fBisDockEnabled\fR ( ToolBarDock dock ) const".br.ti -1c.BI "void \fBaddToolBar\fR ( QToolBar *, ToolBarDock = Top, bool " "newLine" " = FALSE )".br.ti -1c.BI "void \fBaddToolBar\fR ( QToolBar *, const QString & " "label" ", ToolBarDock = Top, bool " "newLine" " = FALSE )".br.ti -1c.BI "void \fBmoveToolBar\fR ( QToolBar *, ToolBarDock = Top )".br.ti -1c.BI "void \fBremoveToolBar\fR ( QToolBar * )".br.ti -1c.BI "virtual void \fBshow\fR ()".br.ti -1c.BI "bool \fBrightJustification\fR () const".br.ti -1c.BI "bool \fBusesBigPixmaps\fR () const".br.ti -1c.BI "virtual bool \fBeventFilter\fR ( QObject *, QEvent * )".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "virtual void \fBsetRightJustification\fR ( bool )".br.ti -1c.BI "virtual void \fBsetUsesBigPixmaps\fR ( bool )".br.ti -1c.BI "void \fBwhatsThis\fR ()".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBpixmapSizeChanged\fR ( bool )".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBpaintEvent\fR ( QPaintEvent * )".br.ti -1c.BI "virtual void \fBresizeEvent\fR ( QResizeEvent * )".br.ti -1c.BI "virtual void \fBchildEvent\fR ( QChildEvent * )".br.ti -1c.BI "virtual bool \fBevent\fR ( QEvent * )".br.ti -1c.BI "virtual void \fBstyleChange\fR ( QStyle & )".br.in -1c.SS "Protected Slots".in +1c.ti -1c.BI "virtual void \fBsetUpLayout\fR ()".br.in -1c.SH DESCRIPTIONThe QMainWindow class provides a typical application window, with a menu bar, some tool bars and a status bar..PPIn addition, you need the large central widget, which you supply and tell QMainWindow about using setCentralWidget(), and perhaps a few tool bars, which you can add using addToolBar()..PPThe central widget is not touched by QMainWindow. QMainWindow manages its geometry, and that is all. For example, the application/application.cpp example (an editor) sets a QMultiLineEdit to be the central widget..PPQMainWindow automatically detects the creation of a menu bar or status bar if you specify the QMainWindow as parent, or you can use the provided menuBar() and statusBar() functions. menuBar() and statusBar() create a suitable widget if one doesn't exist, and updates the window's layout to make space..PPQMainWindow also provides a QToolTipGroup connected to the status bar. toolTipGroup() provides access to the QToolTipGroup, but there is no way to set the tool tip group..PPBy default, QMainWindow only allows toolbars above the central widget. You can use setDockEnabled() to allow toolbars in other docks (a \fIdock\fR is a place where toolbars can stay). Currently, only \fCTop, Left, Right\fR and \fCBottom\fR are meaningful..PPSeveral functions let you change the appearance of a QMainWindow globally: setRightJustification() determines whether QMainWindow should ensure that the toolbars fill the available space, setUsesBigPixmaps() determines whether QToolButton (and other classes) should draw small or large pixmaps (see QIconSet for more about that)..PPThe current release of QMainWindow does not provide draggable toolbars. This feature is planned for inclusion in one of the next releases..PP<img src=qmainwindow-m.png> <img src=qmainwindow-w.png>.PPSee also: QToolBar, QStatusBar, QMenuBar, QToolTipGroup and QDialog..PPExamples:.(lmainlyQt/editor.cpp.)l.SS "Member Type Documentation".SH "QMainWindow::ToolBarDock"Each toolbar can be in one of the following positions:.TP\fCTop\fR - above the central widget, below the menubar..TP\fCBottom\fR - below the central widget, above the status bar..TP\fCLeft\fR - to the left of the central widget..TP\fCRight\fR - to the left of the central widget..PPOther values are also defined for future expansion..SH MEMBER FUNCTION DOCUMENTATION.SH "<a name="9a91e1">QMainWindow::QMainWindow ( QWidget * parent = 0, const char * name = 0, WFlags f = WType_TopLevel )"Constructs an empty main window..SH "QMainWindow::~QMainWindow ()"Destroys the object and frees any allocated resources..SH "void QMainWindow::addToolBar ( QToolBar * toolBar, ToolBarDock edge = Top, bool newLine = FALSE )"Adds \fItoolBar\fR to this the end of \fIedge\fR and makes it start a new line of tool bars if \fInl\fR is TRUE..PPIf \fItoolBar\fR is already managed by some main window, it is first removed from that window..SH "void QMainWindow::addToolBar ( QToolBar * toolBar, const QString & label, ToolBarDock edge = Top, bool newLine = FALSE )"Adds \fItoolBar\fR to this the end of \fIedge,\fR labelling it \fIlabel\fR and makes it start a new line of tool bars if \fInewLine\fR is TRUE..PPIf \fItoolBar\fR is already managed by some main window, it is first removed from that window..SH "QWidget * QMainWindow::centralWidget () const"Returns a pointer to the main child of this main widget. The main child is the big widget around which the tool bars are arranged..PPSee also: setCentralWidget()..PPExamples:.(lqfd/qfd.cpp.)l.SH "void QMainWindow::childEvent ( QChildEvent * e ) \fC[virtual protected]\fR"Monitors events to ensure layout is updated..PPReimplemented from QObject..SH "bool QMainWindow::event ( QEvent * e ) \fC[virtual protected]\fR"Monitors events to ensure layout is updated..PPReimplemented from QObject..SH "bool QMainWindow::eventFilter ( QObject * o, QEvent * e ) \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QObject..SH "bool QMainWindow::isDockEnabled ( ToolBarDock dock ) const"Returns TRUE if \fIdock\fR is enabled, or FALSE if it is not..PPSee also: setDockEnabled()..SH "QMenuBar * QMainWindow::menuBar () const"Returns the menu bar for this window. If there isn't any, menuBar() creates an empty menu bar on the fly..PPSee also: statusBar()..SH "void QMainWindow::moveToolBar ( QToolBar * toolBar, ToolBarDock edge = Top )"Moves \fItoolBar\fR to this the end of \fIedge.\fR.PPIf \fItoolBar\fR is already managed by some main window, it is moved from that window to this and set to \fInot\fR start a new line..SH "void QMainWindow::paintEvent ( QPaintEvent * ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "void QMainWindow::pixmapSizeChanged ( bool ) \fC[signal]\fR"This signal is called whenever the setUsesBigPixmaps() is called with a value which is different from the current setting. All relevant widgets must connect to this signal..SH "void QMainWindow::removeToolBar ( QToolBar * toolBar )"Removes \fItoolBar\fR from this main window, if \fItoolBar\fR is non-null and known by this main window..SH "void QMainWindow::resizeEvent ( QResizeEvent * ) \fC[virtual protected]\fR"Monitors events to ensure layout is updated..PPReimplemented from QWidget..SH "bool QMainWindow::rightJustification () const"Returns TRUE if this main windows right-justifies its toolbars, and FALSE if it uses a ragged right edge..PPThe default is to use a ragged right edge..PP("Right edge" sometimes means "bottom edge".).PPSee also: setRightJustification()..SH "void QMainWindow::setCentralWidget ( QWidget * w ) \fC[virtual]\fR"Sets the central widget for this window to \fIw.\fR The central widget is the one around which the toolbars etc. are arranged..SH "void QMainWindow::setDockEnabled ( ToolBarDock dock, bool enable ) \fC[virtual]\fR"Sets \fIdock\fR to be available if \fIenable\fR is TRUE, and not available if \fIenable\fR is FALSE..PPThe user can drag a toolbar to any enabled dock..SH "void QMainWindow::setRightJustification ( bool enable ) \fC[virtual slot]\fR"Sets this main window to expand its toolbars to fill all available space if \fIenable\fR is TRUE, and to give the toolbars just the space they need if \fIenable\fR is FALSE..PPThe default is FALSE..PPSee also: rightJustification();..SH "void QMainWindow::setUpLayout () \fC[virtual protected slot]\fR"Sets up the geometry management of this window. Called automatically when needed, so you should never need to call this..SH "void QMainWindow::setUsesBigPixmaps ( bool enable ) \fC[virtual slot]\fR"Sets tool buttons in this main windows to use big pixmaps if \fIenable\fR is TRUE, and small pixmaps if \fIenable\fR is FALSE..PPThe default is FALSE..PPTool buttons and other interested widgets are responsible for reading the correct state on startup, and for connecting to this widget's pixmapSizeChanged() signal..PPSee also: QToolButton::setUsesBigPixmap()..SH "void QMainWindow::show () \fC[virtual]\fR"Reimplemented for internal reasons; the API is not affected..PPExamples:.(lthemes/main.cpp mainlyQt/editor.cpp application/main.cpp i18n/main.cpp scribble/main.cpp qfd/qfd.cpp addressbook/main.cpp qfileiconview/main.cpp.)l.PPReimplemented from QWidget..SH "QStatusBar * QMainWindow::statusBar () const"Returns the status bar for this window. If there isn't any, statusBar() creates an empty status bar on the fly, and if necessary a tool tip group too..PPSee also: menuBar() and toolTipGroup()..PPExamples:.(lqfd/qfd.cpp.)l.SH "void QMainWindow::styleChange ( QStyle & old ) \fC[virtual protected]\fR"Reimplemented for internal reasons; the API is not affected..PPReimplemented from QWidget..SH "QToolTipGroup * QMainWindow::toolTipGroup () const"Returns the tool tip group for this window. If there isn't any, menuBar() creates an empty tool tip group on the fly..PPSee also: menuBar() and statusBar()..SH "bool QMainWindow::usesBigPixmaps () const"Returns the state last set by setUsesBigPixmaps(). The initial state is FALSE..PPSee also: setUsesBigPixmaps();..SH "void QMainWindow::whatsThis () \fC[slot]\fR"Enters What's This? question mode and returns immediately..PPThis is the same as QWhatsThis::enterWhatsThisMode(), but as a slot of of a main window object. This way it can be easily used for popup menus as in the code fragment:.PP.nf.br    QPopupMenu * help = new QPopupMenu( this );.br    help->insertItem( "What's &This", this , SLOT(whatsThis()), SHIFT+Key_F1);.fi.PPSee also:  QWhatsThis::enterWhatsThisMode()..SH "SEE ALSO".BR http://www.troll.no/qt/qmainwindow.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 + =
减小字号Ctrl + -
显示快捷键?