📄 qstatusbar.3qt
字号:
'\" t.TH QStatusBar 3qt "9 December 2002" "Trolltech AS" \" -*- nroff -*-.\" Copyright 1992-2001 Trolltech AS. All rights reserved. See the.\" license file included in the distribution for a complete license.\" statement..\".ad l.nh.SH NAMEQStatusBar \- Horizontal bar suitable for presenting status information.SH SYNOPSIS\fC#include <qstatusbar.h>\fR.PPInherits QWidget..PP.SS "Public Members".in +1c.ti -1c.BI "\fBQStatusBar\fR ( QWidget * parent = 0, const char * name = 0 )".br.ti -1c.BI "virtual \fB~QStatusBar\fR ()".br.ti -1c.BI "virtual void \fBaddWidget\fR ( QWidget * widget, int stretch = 0, bool permanent = FALSE )".br.ti -1c.BI "virtual void \fBremoveWidget\fR ( QWidget * widget )".br.ti -1c.BI "void \fBsetSizeGripEnabled\fR ( bool )".br.ti -1c.BI "bool \fBisSizeGripEnabled\fR () const".br.in -1c.SS "Public Slots".in +1c.ti -1c.BI "void \fBmessage\fR ( const QString & message )".br.ti -1c.BI "void \fBmessage\fR ( const QString & message, int ms )".br.ti -1c.BI "void \fBclear\fR ()".br.in -1c.SS "Signals".in +1c.ti -1c.BI "void \fBmessageChanged\fR ( const QString & message )".br.in -1c.SS "Properties".in +1c.ti -1c.BI "bool \fBsizeGripEnabled\fR - whether the QSizeGrip in the bottom right of the status bar is enabled".br.in -1c.SS "Protected Members".in +1c.ti -1c.BI "virtual void \fBpaintEvent\fR ( QPaintEvent * )".br.ti -1c.BI "void \fBreformat\fR ()".br.ti -1c.BI "void \fBhideOrShow\fR ()".br.in -1c.SH DESCRIPTIONThe QStatusBar class provides a horizontal bar suitable for presenting status information..PPEach status indicator falls into one of three categories:.TP\fITemporary\fR - briefly occupies most of the status bar. Used to explain tool tip texts or menu entries, for example..TP\fINormal\fR - occupies part of the status bar and may be hidden by temporary messages. Used to display the page and line number in a word processor, for example..TP\fIPermanent\fR - is never hidden. Used for important mode indications, for example, some applications put a Caps Lock indicator in the status bar..PPQStatusBar lets you display all three types of indicators..PPTo display a \fItemporary\fR message, call message() (perhaps by connecting a suitable signal to it). To remove a temporary message, call clear(). There are two variants of message(): one that displays the message until the next clear() or message() and one that has a time limit:.PP.nf.br connect( loader, SIGNAL(progressMessage(const QString&)),.br statusBar(), SLOT(message(const QString&)) );.br.br statusBar()->message("Loading..."); // Initial message.br loader.loadStuff(); // Emits progress messages.br statusBar()->message("Done.", 2000); // Final message for 2 seconds.br.fi.PP\fINormal\fR and \fIPermanent\fR messages are displayed by creating a small widget and then adding it to the status bar with addWidget(). Widgets like QLabel, QProgressBar or even QToolButton are useful for adding to status bars. removeWidget() is used to remove widgets..PP.nf.br statusBar()->addWidget(new MyReadWriteIndication(statusBar()));.br.fi.PPBy default QStatusBar provides a QSizeGrip in the lower-right corner. You can disable it with setSizeGripEnabled(FALSE);.PP.ce 1.B "[Image Omitted]".PP.ce 1.B "[Image Omitted]".PPSee also QToolBar, QMainWindow, QLabel, GUI Design Handbook: Status Bar, Main Window and Related Classes, and Help System..SH MEMBER FUNCTION DOCUMENTATION.SH "QStatusBar::QStatusBar ( QWidget * parent = 0, const char * name = 0 )"Constructs a status bar called \fIname\fR with parent \fIparent\fR and with a size grip..PPSee also sizeGripEnabled..SH "QStatusBar::~QStatusBar ()\fC [virtual]\fR"Destroys the status bar and frees any allocated resources and child widgets..SH "void QStatusBar::addWidget ( QWidget * widget, int stretch = 0, bool permanent = FALSE )\fC [virtual]\fR"Adds \fIwidget\fR to this status bar. \fIwidget\fR is reparented if it isn't already a child of the QStatusBar..PP\fIwidget\fR is permanently visible if \fIpermanent\fR is TRUE and may be obscured by temporary messages if \fIpermanent\fR is FALSE. The default is FALSE..PPIf \fIpermanent\fR is TRUE, \fIwidget\fR is located at the far right of the status bar. If \fIpermanent\fR is FALSE (the default), \fIwidget\fR is located just to the left of the first permanent widget..PP\fIstretch\fR is used to compute a suitable size for \fIwidget\fR as the status bar grows and shrinks. The default of 0 uses a minimum of space..PPThis function may cause some flicker..PPSee also removeWidget()..SH "void QStatusBar::clear ()\fC [slot]\fR"Removes any temporary message being shown..PPSee also message()..SH "void QStatusBar::hideOrShow ()\fC [protected]\fR"Ensures that the right widgets are visible. Used by message() and clear()..SH "bool QStatusBar::isSizeGripEnabled () const"Returns TRUE if the QSizeGrip in the bottom right of the status bar is enabled; otherwise returns FALSE. See the "sizeGripEnabled" property for details..SH "void QStatusBar::message ( const QString & message )\fC [slot]\fR"Hides the normal status indicators and displays \fImessage\fR until clear() or another message() is called..PPSee also clear()..SH "void QStatusBar::message ( const QString & message, int ms )\fC [slot]\fR"This is an overloaded member function, provided for convenience. It behaves essentially like the above function..PPHides the normal status indications and displays \fImessage\fR for \fIms\fR milli-seconds or until clear() or another message() is called, whichever occurs first..SH "void QStatusBar::messageChanged ( const QString & message )\fC [signal]\fR"This signal is emitted when the temporary status messages changes. \fImessage\fR is the new temporary message, and is a null-string when the message has been removed..PPSee also message() and clear()..SH "void QStatusBar::paintEvent ( QPaintEvent * )\fC [virtual protected]\fR"Shows the temporary message, if appropriate..PPReimplemented from QWidget..SH "void QStatusBar::reformat ()\fC [protected]\fR"Changes the status bar's appearance to account for item changes. Special subclasses may need this, but geometry management will usually take care of any necessary rearrangements..SH "void QStatusBar::removeWidget ( QWidget * widget )\fC [virtual]\fR"Removes \fIwidget\fR from the status bar..PPThis function may cause some flicker..PPNote that \fIwidget\fR is not deleted..PPSee also addWidget()..SH "void QStatusBar::setSizeGripEnabled ( bool )"Sets whether the QSizeGrip in the bottom right of the status bar is enabled. See the "sizeGripEnabled" property for details..SS "Property Documentation".SH "bool sizeGripEnabled"This property holds whether the QSizeGrip in the bottom right of the status bar is enabled..PPEnables or disables the QSizeGrip in the bottom right of the status bar. By default, the size grip is enabled..PPSet this property's value with setSizeGripEnabled() and get this property's value with isSizeGripEnabled()..SH "SEE ALSO".BR http://doc.trolltech.com/qstatusbar.html.BR http://www.trolltech.com/faq/tech.html.SH COPYRIGHTCopyright 1992-2001 Trolltech AS, http://www.trolltech.com. See thelicense file included in the distribution for a complete licensestatement..SH AUTHORGenerated automatically from the source code..SH BUGSIf you find a bug in Qt, please report it as described in.BR http://doc.trolltech.com/bughowto.html .Good bug reports help us to help you. Thank you..PThe definitive Qt documentation is provided in HTML format; it islocated at $QTDIR/doc/html and can be read using Qt Assistant or witha web browser. This man page is provided as a convenience for thoseusers who prefer man pages, although this format is not officiallysupported by Trolltech. .PIf you find errors in this manual page, please report them to.BR qt-bugs@trolltech.com .Please include the name of the manual page (qstatusbar.3qt) and the Qtversion (3.1.1).
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -