From 6933a4ceef6e7209931977268f29292b2144b6d1 Mon Sep 17 00:00:00 2001 From: Johannes Paehr Date: Sun, 28 Dec 2025 20:56:44 +0100 Subject: [PATCH] added first part of hiding live ranking --- windowrace.cpp | 20 +++++++++++++++++--- windowrace.h | 3 +++ 2 files changed, 20 insertions(+), 3 deletions(-) diff --git a/windowrace.cpp b/windowrace.cpp index 130fb21..ab6c82c 100644 --- a/windowrace.cpp +++ b/windowrace.cpp @@ -28,9 +28,16 @@ using std::vector; WindowRace::WindowRace(DataBase * db, QWidget * parent) : QMainWindow(parent), ui(new Ui::WindowRace) { ui->setupUi(this); + this->ui->pBNextRace->setEnabled(false); this->finished = false; + // should be read from db + this->enableLiveRanking = false; + if (!this->enableLiveRanking) { + this->ui->groupBox_15->hide(); + } + this->wRennlisteSeted = false; this->db = db; @@ -177,7 +184,10 @@ WindowRace::WindowRace(DataBase * db, QWidget * parent) tableRaces = db->getData(statement, 4); this->ui->lRound->setText("1/" + QString::number(tableRaces.size())); // QObject::connect(shortcut, SIGNAL(activated()), this, SLOT(close())); - this->prepareLiveRanking(); + + if (this->enableLiveRanking) { + this->prepareLiveRanking(); + } } void WindowRace::prepareLiveRanking() { @@ -613,7 +623,9 @@ void WindowRace::shellSlot(int time, int sector) { ui->lWShellTime->scrollToBottom(); ui->lWShellTime->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch); - this->updateLiveRanking(); + if (this->enableLiveRanking) { + this->updateLiveRanking(); + } } void WindowRace::deaSlot(int time, int sector) { if (started && !paused && !this->finished) { @@ -727,7 +739,9 @@ void WindowRace::deaSlot(int time, int sector) { ui->lWDeaTime->scrollToBottom(); ui->lWDeaTime->horizontalHeader()->setSectionResizeMode( QHeaderView::Stretch); - this->updateLiveRanking(); + if (this->enableLiveRanking) { + this->updateLiveRanking(); + } } long WindowRace::getMinimum(std::vector a) { diff --git a/windowrace.h b/windowrace.h index d05fd31..5b5a685 100644 --- a/windowrace.h +++ b/windowrace.h @@ -49,6 +49,9 @@ class WindowRace : public QMainWindow { QString getNameDriver(QString driverId); QStringListModel modelRanking; + // need database implementation + bool enableLiveRanking; + QStringList QSLRanking; // QStandardItemModel modelRanking; bool started;