blob: 112e239f8ed45981a71d69d12e7253bbca8f2ad3 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
|
#include "ProgressWidget.h"
#include <QTimer>
ProgressWidget::ProgressWidget(QWidget *parent)
:QWidget(parent)
{
setupUi(this);
this->wascanceled = false;
connect(this->stopButton, SIGNAL(clicked()), this, SLOT(cancel()));
QTimer::singleShot(1000, this, SIGNAL(requestShow()));
}
bool ProgressWidget::wasCanceled() const
{
return this->wascanceled;
}
void ProgressWidget::cancel()
{
this->wascanceled = true;
}
void ProgressWidget::setRange(int minimum, int maximum)
{
this->progressBar->setRange(minimum, maximum);
}
void ProgressWidget::setValue(int progress)
{
this->progressBar->setValue(progress);
}
int ProgressWidget::value() const
{
return this->progressBar->value();
}
|