From 1af86b4542abc84807f6d1e971e2342927081824 Mon Sep 17 00:00:00 2001 From: Isabell Pflug Date: Fri, 26 May 2023 12:49:57 +0200 Subject: [PATCH] :bug: Moved disabling and re-enabling of the MainWindow to the correct location --- ThinkPink/mainwindow.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ThinkPink/mainwindow.cpp b/ThinkPink/mainwindow.cpp index 9bb1bd7..de5a213 100644 --- a/ThinkPink/mainwindow.cpp +++ b/ThinkPink/mainwindow.cpp @@ -70,7 +70,6 @@ void MainWindow::bubbleBoxes(std::set> *connected) { bubbleUp((*i)[0], (*i)[1]); } refreshButtonGrid(); - MainWindow::setEnabled(false); qApp->processEvents(); usleep(400000); for (int j = 0; j < columns; j++) { @@ -78,11 +77,11 @@ void MainWindow::bubbleBoxes(std::set> *connected) { checkColumn(j); } refreshButtonGrid(); - MainWindow::setEnabled(true); } // slots void MainWindow::buttonPressed(int row, int column) { + MainWindow::setEnabled(false); if(game->getCell(row, column) != "none") { std::set> connected; game->getConnected(&connected, game->getCell(row, column), row, column); @@ -92,6 +91,7 @@ void MainWindow::buttonPressed(int row, int column) { } else ui->statusBar->showMessage("Only friends get Stars!", 2000); } + MainWindow::setEnabled(true); } void MainWindow::newGame() { @@ -127,8 +127,6 @@ void MainWindow::initialiseGameGrid() { ui->gameGridLayout->addWidget(button, i, j); button_row.push_back(button); - // Set size text etc. for each button - connect(button, &QPushButton::clicked, [=, this](){ buttonPressed(i, j); }); @@ -154,7 +152,6 @@ void MainWindow::refreshSizes() { } void MainWindow::setPalettes() { - QPalette palLight = QPalette(); QPalette palDark = QPalette(); const QBrush bgLightBrush = QBrush(0xfff0f3);