|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.gui.QWidget
com.trolltech.qt.gui.QStatusBar
public class QStatusBar
The QStatusBar
class provides a horizontal bar suitable for presenting status information. Each status indicator falls into one of three categories:
QStatusBar
lets you display all three types of indicators. Typically, a request for the status bar functionality occurs in relation to a QMainWindow
object. QMainWindow
provides a main application window, with a menu bar, tool bars, dock widgets and a status bar around a large central widget. The status bar can be retrieved using the QMainWindow::statusBar()
function, and replaced using the QMainWindow::setStatusBar()
function.
Use the showMessage()
slot to display a temporary message:
The following code example is written in c++.
void MainWindow::createStatusBar() { statusBar()->showMessage(tr("Ready")); }To remove a temporary message, use the
clearMessage()
slot, or set a time limit when calling showMessage()
. For example:void MainWindow::print() { #ifndef QT_NO_PRINTER QTextDocument *document = textEdit->document(); QPrinter printer; QPrintDialog *dlg = new QPrintDialog(&printer, this); if (dlg->exec() != QDialog::Accepted) return; document->print(&printer); statusBar()->showMessage(tr("Ready"), 2000); #endif }Use the
currentMessage()
function to retrieve the temporary message currently shown. The QStatusBar
class also provide the messageChanged()
signal which is emitted whenever the temporary status message changes. Normal and Permanent messages are displayed by creating a small widget (QLabel
, QProgressBar
or even QToolButton
) and then adding it to the status bar using the addWidget()
or the addPermanentWidget()
function. Use the removeWidget()
function to remove such messages from the status bar. statusBar().addWidget(new MyReadWriteIndication());By default
QStatusBar
provides a QSizeGrip
in the lower-right corner. You can disable it using the setSizeGripEnabled()
function. Use the isSizeGripEnabled()
function to determine the current status of the size grip. QMainWindow
, QStatusTipEvent
, GUI Design Handbook: Status Bar, and Application Example.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.gui.QWidget |
---|
QWidget.RenderFlag, QWidget.RenderFlags |
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Field Summary | |
---|---|
QSignalEmitter.Signal1 |
messageChanged
This signal is emitted whenever the temporary status message changes. |
Fields inherited from class com.trolltech.qt.gui.QWidget |
---|
customContextMenuRequested |
Constructor Summary | |
---|---|
QStatusBar()
Constructs a status bar with a size grip and the given parent. |
|
QStatusBar(QWidget parent)
Constructs a status bar with a size grip and the given parent. |
Method Summary | |
---|---|
void |
addPermanentWidget(QWidget widget)
Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
void |
addPermanentWidget(QWidget widget,
int stretch)
Adds the given widget permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
void |
addWidget(QWidget widget)
Adds the given widget to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
void |
addWidget(QWidget widget,
int stretch)
Adds the given widget to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
void |
clearMessage()
Removes any temporary message being shown. |
java.lang.String |
currentMessage()
Returns the temporary message currently shown, or an empty string if there is no such message. |
static QStatusBar |
fromNativePointer(QNativePointer nativePointer)
|
protected void |
hideOrShow()
Ensures that the right widgets are visible. |
int |
insertPermanentWidget(int index,
QWidget widget)
Inserts the given widget at the given index permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
int |
insertPermanentWidget(int index,
QWidget widget,
int stretch)
Inserts the given widget at the given index permanently to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
int |
insertWidget(int index,
QWidget widget)
Inserts the given widget at the given index to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
int |
insertWidget(int index,
QWidget widget,
int stretch)
Inserts the given widget at the given index to this status bar, reparenting the widget if it isn't already a child of this QStatusBar object. |
boolean |
isSizeGripEnabled()
This property holds whether the QSizeGrip in the bottom-right corner of the status bar is enabled. |
protected void |
reformat()
Changes the status bar's appearance to account for item changes. |
void |
removeWidget(QWidget widget)
Removes the specified widget from the status bar. |
void |
setSizeGripEnabled(boolean arg__1)
This property holds whether the QSizeGrip in the bottom-right corner of the status bar is enabled. |
void |
showMessage(java.lang.String text)
Hides the normal status indications and displays the given message for the specified number of milli-seconds (timeout). |
void |
showMessage(java.lang.String text,
int timeout)
Hides the normal status indications and displays the given message for the specified number of milli-seconds (timeout). |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal1 messageChanged
showMessage()
, and clearMessage()
.
Constructor Detail |
---|
public QStatusBar()
setSizeGripEnabled()
.
public QStatusBar(QWidget parent)
setSizeGripEnabled()
.
Method Detail |
---|
public final void addPermanentWidget(QWidget widget)
QStatusBar
object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
insertPermanentWidget()
, removeWidget()
, and addWidget()
.
public final void addPermanentWidget(QWidget widget, int stretch)
QStatusBar
object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
insertPermanentWidget()
, removeWidget()
, and addWidget()
.
public final void addWidget(QWidget widget)
QStatusBar
object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. The widget is located to the far left of the first permanent widget (see addPermanentWidget()
) and may be obscured by temporary messages.
insertWidget()
, removeWidget()
, and addPermanentWidget()
.
public final void addWidget(QWidget widget, int stretch)
QStatusBar
object. The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space. The widget is located to the far left of the first permanent widget (see addPermanentWidget()
) and may be obscured by temporary messages.
insertWidget()
, removeWidget()
, and addPermanentWidget()
.
public final void clearMessage()
currentMessage()
, showMessage()
, and removeWidget()
.
public final java.lang.String currentMessage()
showMessage()
.
protected final void hideOrShow()
Used by the showMessage()
and clearMessage()
functions.
public final int insertPermanentWidget(int index, QWidget widget)
QStatusBar
object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
addPermanentWidget()
, removeWidget()
, and addWidget()
.
public final int insertPermanentWidget(int index, QWidget widget, int stretch)
QStatusBar
object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
Permanently means that the widget may not be obscured by temporary messages. It is is located at the far right of the status bar.
addPermanentWidget()
, removeWidget()
, and addWidget()
.
public final int insertWidget(int index, QWidget widget)
QStatusBar
object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
The widget is located to the far left of the first permanent widget (see addPermanentWidget()
) and may be obscured by temporary messages.
addWidget()
, removeWidget()
, and addPermanentWidget()
.
public final int insertWidget(int index, QWidget widget, int stretch)
QStatusBar
object. If index is out of range, the widget is appended (in which case it is the actual index of the widget that is returned). The stretch parameter is used to compute a suitable size for the given widget as the status bar grows and shrinks. The default stretch factor is 0, i.e giving the widget a minimum of space.
The widget is located to the far left of the first permanent widget (see addPermanentWidget()
) and may be obscured by temporary messages.
addWidget()
, removeWidget()
, and addPermanentWidget()
.
public final boolean isSizeGripEnabled()
QSizeGrip
in the bottom-right corner of the status bar is enabled. The size grip is enabled by default.
protected final void reformat()
Special subclasses may need this function, but geometry management will usually take care of any necessary rearrangements.
public final void removeWidget(QWidget widget)
Note: This function does not delete the widget but hides it. To add the widget again, you must call both the addWidget()
and show()
functions.
addWidget()
, addPermanentWidget()
, and clearMessage()
.
public final void setSizeGripEnabled(boolean arg__1)
QSizeGrip
in the bottom-right corner of the status bar is enabled. The size grip is enabled by default.
public final void showMessage(java.lang.String text)
clearMessage()
slot is called or until the showMessage()
slot is called again to change the message. Note that showMessage()
is called to show temporary explanations of tool tip texts, so passing a timeout of 0 is not sufficient to display a permanent message
.
messageChanged()
, currentMessage()
, and clearMessage()
.
public final void showMessage(java.lang.String text, int timeout)
clearMessage()
slot is called or until the showMessage()
slot is called again to change the message. Note that showMessage()
is called to show temporary explanations of tool tip texts, so passing a timeout of 0 is not sufficient to display a permanent message
.
messageChanged()
, currentMessage()
, and clearMessage()
.
public static QStatusBar fromNativePointer(QNativePointer nativePointer)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |