Add disarme button

This commit is contained in:
2024-03-28 19:32:38 +01:00
parent c384cb24cc
commit 7d196f9522
3 changed files with 19 additions and 1 deletions

View File

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

View File

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

View File

@@ -1,14 +1,19 @@
#pragma once
#include <QLabel>
#include <QPushButton>
#include <QWidget>
#include <QTimer>
#include <QVBoxLayout>
#include <TCPSocket/TCPUtils.hpp>
#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;
};