| Home · All Classes · Main Classes · Deprecated |
Progress indicators are used to visualize graphically the current status of an operation. More...


Public Slots | |
| void | reset () |
| void | setMaximum (int maximum) |
| void | setMinimum (int minimum) |
| void | setRange (int minimum, int maximum) |
| void | setValue (int value) |
| void | setUnknownDuration (bool unknownDuration) |
Signals | |
| void | valueChanged (int value) |
Public Member Functions | |
| MProgressIndicator (QGraphicsItem *parent=0, const QString &viewType=QString()) | |
| virtual | ~MProgressIndicator () |
| int | maximum () const |
| int | minimum () const |
| int | value () const |
| bool | unknownDuration () const |
Static Public Attributes | |
| static const MTheme::ViewType | spinnerType = "spinner" |
| static const MTheme::ViewType | barType = "bar" |
Properties | |
| int | minimum |
| int | maximum |
| int | value |
| bool | unknownDuration |
Progress indicators are used to visualize graphically the current status of an operation.
Progress indicator can have known or unknown duration.
Here's how to create progress bar with fixed range. It also shows how to listen the value changed signal:
MProgressIndicator* progressbar = new MProgressIndicator(parent, MProgressIndicator::barType); progressbar->setRange(0, 9); connect(progressbar, SIGNAL(valueChanged(int)), SLOT(valueChangedSlot(int)));
This is how to create spinner with unknown duration:
MProgressIndicator* spinner = new MProgressIndicator(parent, MProgressIndicator::spinnerType); spinner->setUnknownDuration(true);
Definition at line 81 of file corelib/widgets/mprogressindicator.h.
| MProgressIndicator::MProgressIndicator | ( | QGraphicsItem * | parent = 0, |
|
| const QString & | viewType = QString() | |||
| ) | [explicit] |
Constructs a progress indicator with a parent.
| parent | Parent widget | |
| viewType | Optional Associated view |
Definition at line 52 of file mprogressindicator.cpp.
: MWidgetController(new MProgressIndicatorPrivate, new MProgressIndicatorModel, parent) { setViewType(viewType); Q_D(MProgressIndicator); d->init(); }

| MProgressIndicator::~MProgressIndicator | ( | ) | [virtual] |
| int MProgressIndicator::maximum | ( | ) | const |
Returns the maximum value of the progress indicator.
| int MProgressIndicator::minimum | ( | ) | const |
Returns the minimum value of the progress indicator.
| void MProgressIndicator::reset | ( | ) | [slot] |
Rewinds the indicator and stops unknown duration indicator.
Definition at line 66 of file mprogressindicator.cpp.
{
setValue(minimum());
setUnknownDuration(false);
}

| void MProgressIndicator::setMaximum | ( | int | maximum | ) | [slot] |
| void MProgressIndicator::setMinimum | ( | int | minimum | ) | [slot] |
| void MProgressIndicator::setRange | ( | int | minimum, | |
| int | maximum | |||
| ) | [slot] |
Sets the progress bar's minimum and maximum values to minimum and maximum respectively. If maximum is smaller than minimum, minimum becomes the only legal value. If the current value falls outside the new range, the progress bar is reset with reset().
Definition at line 73 of file mprogressindicator.cpp.
{
model()->setMinimum(minimum);
model()->setMaximum(qMax(minimum, maximum));
if (model()->value() < model()->minimum() || model()->value() > model()->maximum())
reset();
}

| void MProgressIndicator::setUnknownDuration | ( | bool | unknownDuration | ) | [slot] |
Sets whether the indicator is working in known duration / unknown duration mode.
| run | True, to set the progress indicator to unknown duration mode |
Definition at line 123 of file mprogressindicator.cpp.
{
model()->setUnknownDuration(unknownDuration);
}

| void MProgressIndicator::setValue | ( | int | value | ) | [slot] |
Set the value of the indicator. Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
| value | indicator value |
Definition at line 81 of file mprogressindicator.cpp.
{
if (model()->value() == value)
return;
if ((value > model()->maximum()) || (value < model()->minimum()))
return;
model()->setValue(value);
emit valueChanged(value);
}

| bool MProgressIndicator::unknownDuration | ( | ) | const |
Status of indicating progress with unknown duration.
| int MProgressIndicator::value | ( | ) | const |
Returns the value of the progress indicator.
| void MProgressIndicator::valueChanged | ( | int | value | ) | [signal] |
Signal is emitted when the value of the indicator changes.
MProgressIndicator::barType = "bar" [static] |
View type for progress bar.
Definition at line 130 of file corelib/widgets/mprogressindicator.h.
MProgressIndicator::spinnerType = "spinner" [static] |
View type for spinner.
Definition at line 125 of file corelib/widgets/mprogressindicator.h.
MProgressIndicator::maximum [read, write] |
This property holds the progress indicator's maximum value.
When setting this property, the minimum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset().
Definition at line 102 of file corelib/widgets/mprogressindicator.h.
MProgressIndicator::minimum [read, write] |
This property holds the progress indicator's minimum value.
When setting this property, the maximum is adjusted if necessary to ensure that the range remains valid. If the current value falls outside the new range, the progress bar is reset with reset().
Definition at line 93 of file corelib/widgets/mprogressindicator.h.
MProgressIndicator::unknownDuration [read, write] |
This property holds whether the progress indicator is type of known duration / unknown duration.
Definition at line 117 of file corelib/widgets/mprogressindicator.h.
MProgressIndicator::value [read, write] |
This property holds the progress indicator's current value.
Attempting to change the current value to one outside the minimum-maximum range has no effect on the current value.
Definition at line 111 of file corelib/widgets/mprogressindicator.h.
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:14:26 (PDT) Doxygen 1.7.1 |
MeeGo Touch |