added first part of hiding live ranking

This commit is contained in:
2025-12-28 20:56:44 +01:00
parent 9e61e83d0c
commit 6933a4ceef
2 changed files with 20 additions and 3 deletions

View File

@@ -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()));
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);
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);
if (this->enableLiveRanking) {
this->updateLiveRanking();
}
}
long WindowRace::getMinimum(std::vector<long> a) {

View File

@@ -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;