-
Notifications
You must be signed in to change notification settings - Fork 21
Expand file tree
/
Copy pathProgressDlg.cpp
More file actions
85 lines (69 loc) · 1.66 KB
/
Copy pathProgressDlg.cpp
File metadata and controls
85 lines (69 loc) · 1.66 KB
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#include "ProgressDlg.h"
#include "style.h"
ProgressDlg::ProgressDlg(QWidget * parent) : QDialog(parent),
m_iMinValue(0),
m_iMaxValue(100),
m_iStepValue(1)
{
setupUi(this);
QString style;
style = Style::dialog();
style += Style::label();
style += Style::pushButton();
setStyleSheet(style);
style = Style::progressBar();
progressBar->setStyleSheet(style);
setWindowFlags(Qt::Window | Qt::FramelessWindowHint);
setStatusInfo(tr(""));
setActionInfo(tr(""));
setWindowOpacity(0.95);
stopButton->hide();
}
ProgressDlg::~ProgressDlg() {
}
void ProgressDlg::setProgressData(int _iMinValue, int _iMaxValue, int _iStepValue)
{
m_iMinValue = _iMinValue;
m_iMaxValue = _iMaxValue;
m_iStepValue = _iStepValue;
progressBar->setMinimum(m_iMinValue);
progressBar->setMaximum(m_iMaxValue);
progressBar->setValue(0);
}
void ProgressDlg::stepIt()
{
progressBar->setValue(progressBar->value() + m_iStepValue);
}
void ProgressDlg::setValue(int _value)
{
progressBar->setValue(_value);
}
void ProgressDlg::setStatusInfo(QString _strInfo)
{
lblStatusInfo->setText(_strInfo);
}
void ProgressDlg::setActionInfo(QString _strInfo)
{
lblActionInfo->setText(_strInfo);
}
void ProgressDlg::updateStatusInfo(QString _strInfo)
{
lblStatusInfo->setText(_strInfo);
}
void ProgressDlg::updateActionInfo(QString _strInfo)
{
lblActionInfo->setText(_strInfo);
}
void ProgressDlg::reject()
{
// to skip ESC
}
void ProgressDlg::setCancelable(bool _cancelable)
{
if (_cancelable) {
stopButton->show();
connect(stopButton, &QPushButton::clicked, this, &ProgressDlg::canceled);
} else {
stopButton->hide();
}
}