diff options
Diffstat (limited to 'src/ProgressWidget.cc')
-rw-r--r-- | src/ProgressWidget.cc | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/ProgressWidget.cc b/src/ProgressWidget.cc index 112e239..ce66405 100644 --- a/src/ProgressWidget.cc +++ b/src/ProgressWidget.cc @@ -5,7 +5,11 @@ ProgressWidget::ProgressWidget(QWidget *parent) :QWidget(parent) { setupUi(this); + setRange(0, 100); + setValue(0); this->wascanceled = false; + this->starttime.start(); + connect(this->stopButton, SIGNAL(clicked()), this, SLOT(cancel())); QTimer::singleShot(1000, this, SIGNAL(requestShow())); } @@ -15,6 +19,14 @@ bool ProgressWidget::wasCanceled() const return this->wascanceled; } +/*! + Returns milliseconds since this widget was created +*/ +int ProgressWidget::elapsedTime() const +{ + return this->starttime.elapsed(); +} + void ProgressWidget::cancel() { this->wascanceled = true; |