-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathprogressbarundefinedvalue.cpp
More file actions
45 lines (40 loc) · 909 Bytes
/
Copy pathprogressbarundefinedvalue.cpp
File metadata and controls
45 lines (40 loc) · 909 Bytes
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
#include "progressbarundefinedvalue.h"
ProgressBarUndefinedValue::ProgressBarUndefinedValue(QObject *parent) :
QThread(parent)
{
}
void ProgressBarUndefinedValue::ProgressBarUpDown()
{
int i;
for (i=0;i<21;i++){
emit setValue(i);
this->msleep(15);
}
emit setInvertedAppearance(true);
for (i=20;i>-1;i--){
setValue(i);
this->msleep(15);
}
for (i=0;i<21;i++){
setValue(i);
this->msleep(15);
}
emit setInvertedAppearance(false);
for (i=20;i>-1;i--){
setValue(i);
this->msleep(15);
}
}
void ProgressBarUndefinedValue::run()
{
while (this->keepRunning){
this->ProgressBarUpDown();
}
}
void ProgressBarUndefinedValue::setKeepRunning(bool state)
{
//melhor testar antes de fazer lock. isso pode dar excessao
mutex.lock();
this->keepRunning = state;
mutex.unlock();
}