fix not termintated thread in windowrace + added preparation for highlighting absolute best times

This commit is contained in:
2017-09-12 13:48:10 +02:00
parent 032e354152
commit 5255b40e78
6 changed files with 62 additions and 23 deletions

View File

@@ -25,7 +25,6 @@ WindowRace::WindowRace(DataBase *db, QWidget *parent) :
this->wRennlisteSeted = false;
this->db = db;
vector< vector< QString > > res;
@@ -240,6 +239,7 @@ void WindowRace::setDriverAndCarId(vector<QString> vec){
}
void WindowRace::closeEvent(QCloseEvent *event){
countdown->setStop();
this->Hardware->setStop();
QMessageBox msgBox;
msgBox.setText("Wirklich schliessen?");
@@ -337,13 +337,18 @@ void WindowRace::shellSlot(int time, int sector){
}
else{
// long zeit = counterShell.getTime();
QVector<int> test;
switch(sector){
case 1:
VecShell.append(QVector<int>());
VecShell.last().append(time);
// update tableview
this->timeModelShell = new TimeModel(VecShell, this);
test.append(1);
test.append(2);
test.append(3);
this->timeModelShell = new TimeModel(VecShell, test, this);
// this->ui->lWShellTime->setModel(this->timeModelShell);
ui->lWShellTime->setModel(this->timeModelShell);
break;
@@ -354,7 +359,12 @@ void WindowRace::shellSlot(int time, int sector){
VecShell.last().append(time);
}
// update tableview
timeModelShell = new TimeModel(VecShell, this);
test.append(1);
test.append(2);
test.append(3);
this->timeModelShell = new TimeModel(VecShell, test, this);
// timeModelShell = new TimeModel(VecShell, this);
this->ui->lWShellTime->setModel(timeModelShell);
}
break;
@@ -370,7 +380,12 @@ void WindowRace::shellSlot(int time, int sector){
ui->lCurRoundTimeShell->setText(QString::number((double)QVectorHelper::getCurTime(VecShell.last())/1000));
// update tableview
timeModelShell = new TimeModel(VecShell, this);
test.append(1);
test.append(2);
test.append(3);
this->timeModelShell = new TimeModel(VecShell, test, this);
// timeModelShell = new TimeModel(VecShell, this);
this->ui->lWShellTime->setModel(timeModelShell);
int zeit = QVectorHelper::getMin(VecShell);
QString statement = "insert into Zeiten (id_rennen, id_fahrer, id_auto, id_bahn, zeit) values ("+QString::number(this->renn_id)+