diff --git a/MainWindow.h b/MainWindow.h index ca6eafd..99bb8d9 100644 --- a/MainWindow.h +++ b/MainWindow.h @@ -81,6 +81,11 @@ public: this->waintingForTirette = new WaintingForTirette(centralWidget); connect(this->waintingForTirette, &WaintingForTirette::startGame, this, &MainWindow::onStartGame); + connect(this->waintingForTirette, &WaintingForTirette::disarmePressed, [&]() + { + this->waitingForTiretteValue = false; + this->setWidgetNb(0); + }); this->testMode = new TestMode(centralWidget); connect(this->testMode, &TestMode::goPressed, this, &MainWindow::moveRobot); diff --git a/TestMode.h b/TestMode.h index 6781847..03a6e06 100644 --- a/TestMode.h +++ b/TestMode.h @@ -20,7 +20,6 @@ public: textcm->setStyleSheet("font-size: 14px; font-weight: bold; color: black;"); this->textcm->setAlignment(Qt::AlignCenter); this->mainLayout->addWidget(textcm); - this->textrad = new QLabel("(en rad)", this); textrad->setStyleSheet("font-size: 14px; font-weight: bold; color: black;"); this->textrad->setAlignment(Qt::AlignCenter); diff --git a/WaintingForTirette.h b/WaintingForTirette.h index 0cdddab..1bcdead 100644 --- a/WaintingForTirette.h +++ b/WaintingForTirette.h @@ -1,14 +1,19 @@ #pragma once #include +#include #include #include #include #include +#include "homeButton.h" + + class WaintingForTirette : public QWidget { Q_OBJECT public: + WaintingForTirette(QWidget* parent = nullptr) : QWidget(parent) { this->mainLayout = new QVBoxLayout(this); @@ -31,6 +36,13 @@ public: } this->wating->setText(message); }); + + this->disarme = new QPushButton("Disarme", this); + this->disarme->setStyleSheet("background-color: #5FC8E6; border-radius: 20px; height: 66px; width: 378px; color: black; font-size: 33px;"); + this->disarme->setBaseSize(378, 66); + this->mainLayout->addWidget(this->disarme); + connect(this->disarme, &QPushButton::pressed, this, &WaintingForTirette::disarmePressed); + } ~WaintingForTirette() @@ -58,6 +70,7 @@ public: signals: void startGame(); + void disarmePressed(); private: @@ -65,6 +78,7 @@ private: QLabel* title; QLabel* wating; QTimer* timer; + QPushButton* disarme; int i = 0; };