diff --git a/windowrace.cpp b/windowrace.cpp index 0899a86..44352d6 100644 --- a/windowrace.cpp +++ b/windowrace.cpp @@ -111,6 +111,12 @@ WindowRace::WindowRace(DataBase *db, QWidget *parent) : this->deaDriverId = tableData[0][2].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(){ this->firstTimeShell = true; @@ -138,6 +144,9 @@ void WindowRace::prepareNextRace(){ this->ui->pBNextRace->setEnabled(false); this->ui->lCountdown->setText(timeWrapper(countdownValue)); + //progressbar + this->ui->pbTime->setStyleSheet("QProgressBar::chunk { color: #05B8CC;}"); + this->ui->pbTime->setValue(0); //Ampel Setup ui->WAmpel15->hide(); @@ -239,6 +248,8 @@ void WindowRace::countdownUpdate(){ countdownValue -= 1; if(countdownValue <= 15){ ui->lCountdown->setStyleSheet("QLabel { color: red; }"); + this->ui->pbTime->setStyleSheet( "QProgressBar::chunk { background-color: yellow; }"); + //this->ui->pbTime-> } if(countdownValue <= -1){ this->finished = true; @@ -247,6 +258,7 @@ void WindowRace::countdownUpdate(){ } else{ ui->lCountdown->setText(timeWrapper(countdownValue)); + this->ui->pbTime->setValue(this->fahrzeit-countdownValue); } } } diff --git a/windowrace.ui b/windowrace.ui index e3ab3c6..66d1588 100644 --- a/windowrace.ui +++ b/windowrace.ui @@ -15,6 +15,17 @@ + + + + + + + + 24 + + +