| Home · All Classes · Grouped Classes · Annotated · Functions |
The QWaitWidget class provides an informative idle screen for a slow operation. More...
#include <QWaitWidget>
Inherits QDialog.
The QWaitWidget class provides an informative idle screen for a slow operation.
A wait widget is used to give the user an indication that an operation is going to take some time, and to demonstrate that the application has not frozen. It can also give the user an opportunity to abort the operation when setCancelEnabled() is set to be true.
For example, construct a QWaitWidget to popup over parent.
QWaitWidget *waitWidget = new QWaitWidget(this);
waitWidget->show();
// do time consuming operations
delete waitWidget;
Use setText() and setCancelEnabled() to give more feedback and control to the user. For example,
QWaitWidget *waitWidget = new QWaitWidget(this);
waitWidget->setCancelEnabled( true );
waitWidget->setText( "Searching..." );
waitWidget->show();
QDir dir = QDir::current();
QFileInfoList list = dir.entryInfoList();
int totalSize = 0;
for ( int i = 0; i < dir.count(); i++ ) {
totalSize += list.at( i ).size();
waitWidget->setText( QString( "Size: %1 bytes" ).arg( QString::number(totalSize) ) );
}
waitWidget->hide();
The wait widget, in this example, emits a signal cancelled() when the user presses the Cancel button.

Constructs an QWaitWidget object with the given parent.
This signal is emitted whenever the wait widget dialog is cancelled by user.
Hides the widget and its child widgets.
Sets whether the Cancel button appears on the context menu to enabled. When the Cancel button is presed the signal cancelled() is emitted.
See also cancelled().
Blends the image with color col.
Hides the widget after msec.
Sets the informative text label for this wait widget.
Shows the widget and its child widgets. The widget is shown maximized.
Returns whether the widget was cancelled by the user when it was last shown.
| Copyright © 2007 Trolltech | Trademarks | Qtopia 4.2.5 |