added progressbar in racewindow

This commit is contained in:
2014-12-22 19:21:26 +01:00
parent db4d19413e
commit 72f153679a
2 changed files with 23 additions and 0 deletions
+12
View File
@@ -111,6 +111,12 @@ WindowRace::WindowRace(DataBase *db, QWidget *parent) :
this->deaDriverId = tableData[0][2].toInt(); this->deaDriverId = tableData[0][2].toInt();
this->deaCarId = tableData[0][3].toInt(); this->deaCarId = tableData[0][3].toInt();
//progressbar
this->ui->pbTime->setMaximum(this->fahrzeit);
this->ui->pbTime->setMinimum(0);
this->ui->pbTime->setTextVisible(false);
this->ui->pbTime->setStyleSheet("QProgressBar::chunk { color: #05B8CC;}");
} }
void WindowRace::prepareNextRace(){ void WindowRace::prepareNextRace(){
this->firstTimeShell = true; this->firstTimeShell = true;
@@ -138,6 +144,9 @@ void WindowRace::prepareNextRace(){
this->ui->pBNextRace->setEnabled(false); this->ui->pBNextRace->setEnabled(false);
this->ui->lCountdown->setText(timeWrapper(countdownValue)); this->ui->lCountdown->setText(timeWrapper(countdownValue));
//progressbar
this->ui->pbTime->setStyleSheet("QProgressBar::chunk { color: #05B8CC;}");
this->ui->pbTime->setValue(0);
//Ampel Setup //Ampel Setup
ui->WAmpel15->hide(); ui->WAmpel15->hide();
@@ -239,6 +248,8 @@ void WindowRace::countdownUpdate(){
countdownValue -= 1; countdownValue -= 1;
if(countdownValue <= 15){ if(countdownValue <= 15){
ui->lCountdown->setStyleSheet("QLabel { color: red; }"); ui->lCountdown->setStyleSheet("QLabel { color: red; }");
this->ui->pbTime->setStyleSheet( "QProgressBar::chunk { background-color: yellow; }");
//this->ui->pbTime->
} }
if(countdownValue <= -1){ if(countdownValue <= -1){
this->finished = true; this->finished = true;
@@ -247,6 +258,7 @@ void WindowRace::countdownUpdate(){
} }
else{ else{
ui->lCountdown->setText(timeWrapper(countdownValue)); ui->lCountdown->setText(timeWrapper(countdownValue));
this->ui->pbTime->setValue(this->fahrzeit-countdownValue);
} }
} }
} }
+11
View File
@@ -15,6 +15,17 @@
</property> </property>
<widget class="QWidget" name="centralwidget"> <widget class="QWidget" name="centralwidget">
<layout class="QVBoxLayout" name="verticalLayout_18"> <layout class="QVBoxLayout" name="verticalLayout_18">
<item>
<widget class="QProgressBar" name="pbTime">
<property name="styleSheet">
<string notr="true">
</string>
</property>
<property name="value">
<number>24</number>
</property>
</widget>
</item>
<item> <item>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <layout class="QHBoxLayout" name="horizontalLayout_2">
<item> <item>