Verified Commit 4362ab23 authored by Romain De Laage De Bellefaye's avatar Romain De Laage De Bellefaye 🌳
Browse files

Fix to compile

parent cacd80d1
#ifndef _PARAMALPHA_H
#define _PARAMALPHA_H
class ParamAlpha: public QObject {
#include <QObject>
#include <QPushButton>
#include <QSpinBox>
#include <QLineEdit>
#include <QGridLayout>
#include <QWidget>
#include <QFormLayout>
#include <reseau_cellule_etats.h>
#include <Automate.h>
class ParamAlpha: public QWidget {
Q_OBJECT
private:
EnsembleEtat ense;
......@@ -14,7 +24,7 @@ class ParamAlpha: public QObject {
QSpinBox* green[8];
QSpinBox* blue[8];
QPushButton valider("Valider", this);
QPushButton* valider;
public slots:
void addEtats(const int nbEtats);
void valide();
......
......@@ -14,41 +14,41 @@ void ParamAlpha::addEtats(const int nbEtats) {
valider = new QPushButton("Valider");
for(size_t i = 0; i < nb; ++i) {
for(int i = 0; i < nb; ++i) {
form[i] = new QFormLayout;
red[i] = new QSpinBox;
green[i] = new QSpinBox;
blue[i] = new QSpinBox;
label[i] = new QLineEdit;
red[i].setRange(0,255);
green[i].setRange(0,255);
blue[i].setRange(0,255);
red[i]->setRange(0,255);
green[i]->setRange(0,255);
blue[i]->setRange(0,255);
std::string formLabel = "Etat ";
formLabel = formLabel + std::to_string(i);
form[i].addWidget(new QLabel(formLabel.c_str()));
form[i].addRow("Label:", label[i]);
form[i].addRow("Rouge:", red[i]);
form[i].addRow("Vert:", green[i]);
form[i].addRow("Bleu:", blue[i]);
form[i]->addWidget(new QLabel(formLabel.c_str()));
form[i]->addRow("Label:", label[i]);
form[i]->addRow("Rouge:", red[i]);
form[i]->addRow("Vert:", green[i]);
form[i]->addRow("Bleu:", blue[i]);
}
connect(valider, SIGNAL(clicked()), this, SLOT(valide()));
general->addWidget(form[0], 0, 0, 1, 1);
general->addLayout(form[0], 0, 0, 1, 1);
if(nb >= 2)
general->addWidget(form[0], 0, 1, 1, 1);
general->addLayout(form[0], 0, 1, 1, 1);
if(nb >= 3)
general->addWidget(form[0], 0, 2, 1, 1);
general->addLayout(form[0], 0, 2, 1, 1);
if(nb >= 4)
general->addWidget(form[0], 1, 0, 1, 1);
general->addLayout(form[0], 1, 0, 1, 1);
if(nb >= 5)
general->addWidget(form[0], 1, 1, 1, 1);
general->addLayout(form[0], 1, 1, 1, 1);
if(nb >= 6)
general->addWidget(form[0], 1, 2, 1, 1);
general->addLayout(form[0], 1, 2, 1, 1);
if(nb >= 7)
general->addWidget(form[0], 2, 0, 1, 1);
general->addLayout(form[0], 2, 0, 1, 1);
if(nb == 8)
general->addWidget(form[0], 2, 1, 1, 1);
general->addLayout(form[0], 2, 1, 1, 1);
general->addWidget(valider, 2, 1, 1, 1);
}
......@@ -56,7 +56,7 @@ void ParamAlpha::valide() {
EnsembleEtat& e = Automate::getInstance().getEnsemble();
e.reset();
for(size_t i = 0; i < nb; ++i) {
e.ajouterEtat(i, label[i].text().toStdString(), red[i].value(), green[i].value(), blue[i].value());
for(int i = 0; i < nb; ++i) {
e.ajouterEtat(i, label[i]->text().toStdString(), red[i]->value(), green[i]->value(), blue[i]->value());
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment