Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Romain De Laage De Bellefaye
LO21-projet
Commits
9f901460
Verified
Commit
9f901460
authored
Jun 12, 2021
by
Romain De Laage De Bellefaye
🌳
Browse files
Merge branch 'master' of gitlab.utc.fr:rdelaage/lo21-projet
parents
69dfbf70
62a1b218
Pipeline
#79751
passed with stage
in 15 seconds
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
.DS_Store
0 → 100644
View file @
9f901460
File added
cellulut.pro.user
View file @
9f901460
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.15.0, 2021-06-12T1
0:29:37
. -->
<!-- Written by QtCreator 4.15.0, 2021-06-12T1
1:33:14
. -->
<qtcreator>
<data>
<variable>
EnvironmentId
</variable>
...
...
@@ -89,16 +89,16 @@
<variable>
ProjectExplorer.Project.Target.0
</variable>
<valuemap
type=
"QVariantMap"
>
<value
type=
"QString"
key=
"DeviceType"
>
Desktop
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop
Qt 5.15.0 clang
64bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop
Qt 5.15.0 clang
64bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
qt.qt5.5150.clang_64_kit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop
(x86-darwin-generic-mach_o-
64bit
)
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop
(x86-darwin-generic-mach_o-
64bit
)
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
{095244ee-7ce5-4b54-ade5-f51fdf565601}
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveBuildConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveDeployConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveRunConfiguration"
>
0
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.0"
>
<value
type=
"int"
key=
"EnableQmlDebugging"
>
0
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Debug
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -135,8 +135,8 @@
<value
type=
"int"
key=
"Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration"
>
2
</value>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.1"
>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Release
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -175,8 +175,8 @@
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.2"
>
<value
type=
"int"
key=
"EnableQmlDebugging"
>
0
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Profile
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -299,7 +299,7 @@
<value
type=
"bool"
key=
"RunConfiguration.UseLibrarySearchPath"
>
true
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebugger"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebuggerAuto"
>
true
</value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory.default"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Debug/cellulut.app/Contents/MacOS
</value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory.default"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Debug/cellulut.app/Contents/MacOS
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.RunConfigurationCount"
>
1
</value>
</valuemap>
...
...
@@ -308,16 +308,16 @@
<variable>
ProjectExplorer.Project.Target.1
</variable>
<valuemap
type=
"QVariantMap"
>
<value
type=
"QString"
key=
"DeviceType"
>
Desktop
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop
(x86-darwin-generic-mach_o-
64bit
)
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop
(x86-darwin-generic-mach_o-
64bit
)
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
{095244ee-7ce5-4b54-ade5-f51fdf565601}
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DefaultDisplayName"
>
Desktop
Qt 5.15.0 clang
64bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.DisplayName"
>
Desktop
Qt 5.15.0 clang
64bit
</value>
<value
type=
"QString"
key=
"ProjectExplorer.ProjectConfiguration.Id"
>
qt.qt5.5150.clang_64_kit
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveBuildConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveDeployConfiguration"
>
0
</value>
<value
type=
"int"
key=
"ProjectExplorer.Target.ActiveRunConfiguration"
>
0
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.0"
>
<value
type=
"int"
key=
"EnableQmlDebugging"
>
0
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Debug
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Debug
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -354,8 +354,8 @@
<value
type=
"int"
key=
"Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration"
>
2
</value>
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.1"
>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Release
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Release
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -394,8 +394,8 @@
</valuemap>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.Target.BuildConfiguration.2"
>
<value
type=
"int"
key=
"EnableQmlDebugging"
>
0
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
x86_darwin_generic_mach_o
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Profile
</value>
<value
type=
"QString"
key=
"ProjectExplorer.BuildConfiguration.BuildDirectory.shadowDir"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_
Qt_5_15_0_clang
_64bit-Profile
</value>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildConfiguration.BuildStepList.0"
>
<valuemap
type=
"QVariantMap"
key=
"ProjectExplorer.BuildStepList.Step.0"
>
<value
type=
"bool"
key=
"ProjectExplorer.BuildStep.Enabled"
>
true
</value>
...
...
@@ -518,6 +518,7 @@
<value
type=
"bool"
key=
"RunConfiguration.UseLibrarySearchPath"
>
true
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebugger"
>
false
</value>
<value
type=
"bool"
key=
"RunConfiguration.UseQmlDebuggerAuto"
>
true
</value>
<value
type=
"QString"
key=
"RunConfiguration.WorkingDirectory.default"
>
/Users/maximegoret/Documents/LO21/build-cellulut-Desktop_Qt_5_15_0_clang_64bit-Debug/cellulut.app/Contents/MacOS
</value>
</valuemap>
<value
type=
"int"
key=
"ProjectExplorer.Target.RunConfigurationCount"
>
1
</value>
</valuemap>
...
...
includes/paramalpha.h
View file @
9f901460
...
...
@@ -27,7 +27,7 @@ class ParamAlpha: public QWidget {
public:
/// Construire une fenêtre de paramétrage de l'alphabet
/// @param[in] nbEtats nombre d'états à initialiser
ParamAlpha
(
const
int
nbEtats
);
ParamAlpha
(
const
int
nbEtats
,
const
QWidget
*
parent
);
public
slots
:
/// Valider le paramétrage de l'alphabet, a pour effet de l'initialiser dans l'automate
void
valide
();
...
...
includes/parametragemodele.h
View file @
9f901460
...
...
@@ -50,21 +50,24 @@ class NouveauModele : public QWidget {
QComboBox
*
liste_regle_transition
=
nullptr
;
QPushButton
*
bouton_valide
;
QPushButton
*
valider_Etat
=
nullptr
;
QPushButton
*
valider_EtatDefault
=
nullptr
;
QHBoxLayout
*
layoutvalid
=
nullptr
;
//definition frame règle de transitions
QWidget
*
fenetre_regle
;
QLabel
*
seuilMax
;
QLabel
*
seuilMin
;
QLabel
*
destination
;
QLabel
*
etatCourant
;
QLabel
*
seuilMax
=
nullptr
;
QLabel
*
seuilMin
=
nullptr
;
QLabel
*
destination
=
nullptr
;
QLabel
*
etatCourant
=
nullptr
;
QLabel
*
etatCourant2
=
nullptr
;
QLabel
*
etat_d
=
nullptr
;
QLabel
*
etat
;
QLabel
*
etat
=
nullptr
;
QComboBox
*
valid_Etat
;
QSpinBox
*
numEtatCourant
=
nullptr
;
QSpinBox
*
etatDest
;
QSpinBox
*
etatDest
=
nullptr
;
QSpinBox
*
etat_default
=
nullptr
;
QPushButton
*
fin
=
nullptr
;
...
...
@@ -118,6 +121,9 @@ public slots:
void
addRegle
();
void
changerRegle
();
void
changerEtatDefault
();
// void validerParametrage();
...
...
src/paramalpha.cpp
View file @
9f901460
...
...
@@ -2,7 +2,7 @@
#include
<Automate.h>
#include
<parametragemodele.h>
ParamAlpha
::
ParamAlpha
(
const
int
nbEtats
)
:
QWidget
(),
nb
(
nbEtats
)
{
ParamAlpha
::
ParamAlpha
(
const
int
nbEtats
,
const
QWidget
*
parent
)
:
QWidget
(),
nb
(
nbEtats
)
{
this
->
setWindowTitle
(
"Configuration des états"
);
this
->
setMinimumSize
(
900
,
700
);
...
...
@@ -28,7 +28,10 @@ ParamAlpha::ParamAlpha(const int nbEtats): QWidget(), nb(nbEtats) {
form
[
i
]
->
addRow
(
"Vert:"
,
green
[
i
]);
form
[
i
]
->
addRow
(
"Bleu:"
,
blue
[
i
]);
}
connect
(
valider
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
changerRegle
()));
<<<<<<<
HEAD
=======
connect
(
valider
,
SIGNAL
(
clicked
()),
parent
,
SLOT
(
changerRegle
()));
>>>>>>>
79
d70f004b9e06f9113a2a1d2873a97e332be23d
connect
(
valider
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
valide
()));
...
...
src/parametragemodele.cpp
View file @
9f901460
#include
"parametragemodele.h"
#include
<autocell.h>
#include
<Automate.h>
#include
<autosql.h>
#include
<autosql.h>
NouveauModele
::
NouveauModele
(
QWidget
*
parent
)
:
QWidget
()
{
...
...
@@ -76,11 +76,20 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
layoutEtat
=
new
QHBoxLayout
;
layoutEtat
->
addWidget
(
etat
);
layoutEtat
->
addWidget
(
nb_etats
);
layoutEtat
->
addWidget
(
boutonEtat
);
<<<<<<<
HEAD
valider_Etat
=
new
QPushButton
(
"Valider le nombre d'états"
);
=======
connect
(
boutonEtat
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
parametrerEtats
()));
connect
(
boutonEtat
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
changerRegle
()));
>>>>>>>
79
d70f004b9e06f9113a2a1d2873a97e332be23d
connect
(
bouton_valide
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
validerParametrage
()));
connect
(
valider_Etat
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
changerEtatDefault
()));
//ajout regle :
form_choix
->
addRow
(
"Nom du modèle : "
,
nom_modele
);
...
...
@@ -89,6 +98,13 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
form_choix
->
addRow
(
"Année :"
,
annee
);
form_choix
->
addRow
(
"Description :"
,
description
);
form_choix
->
addRow
(
layoutEtat
);
form_choix
->
addRow
(
valider_Etat
);
//form_choix->addRow("Etat défaut :", etat_default);
general
->
addWidget
(
fenetre_init
,
0
,
0
,
9
,
1
);
...
...
@@ -115,7 +131,7 @@ NouveauModele::NouveauModele(QWidget* parent) : QWidget() {
}
void
NouveauModele
::
parametrerEtats
()
{
paramAlpha
.
reset
(
new
ParamAlpha
(
nb_etats
->
value
()));
paramAlpha
.
reset
(
new
ParamAlpha
(
nb_etats
->
value
()
,
this
));
paramAlpha
->
show
();
}
...
...
@@ -326,6 +342,8 @@ void NouveauModele::choisirEtatCourant(const QString& validEtat){
}
void
NouveauModele
::
paramRegle
(
const
QString
&
choix_regle
)
{
seuilMax
=
new
QLabel
(
"Seuil Max : "
);
seuilMin
=
new
QLabel
(
"Seuil Min : "
);
destination
=
new
QLabel
(
"Destination : "
);
...
...
@@ -335,7 +353,7 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
etat_default
=
new
QSpinBox
;
etat_default
->
setRange
(
0
,(
nb_etats
->
value
())
-
1
);
QSpinBox
*
etatDest
=
new
QSpinBox
;
etatDest
=
new
QSpinBox
;
etatDest
->
setRange
(
0
,
nb_etats
->
value
()
-
1
);
valid_Etat
=
new
QComboBox
;
...
...
@@ -343,10 +361,14 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
valid_Etat
->
addItem
(
"Non"
);
valid_Etat
->
setCurrentIndex
(
-
1
);
if
(
choix_regle
==
"Nouvelle fonction de transition"
)
{
seuilValidator
=
new
QIntValidator
;
if
(
layouth
!=
nullptr
)
delete
layouth
;
//if(layouth != nullptr) delete layouth;
if
(
layouth1
!=
nullptr
)
delete
layouth1
;
if
(
layouth2
!=
nullptr
)
delete
layouth2
;
if
(
layouth3
!=
nullptr
)
delete
layouth3
;
...
...
@@ -358,7 +380,7 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
layoutv
=
new
QVBoxLayout
;
layouth
=
new
QHBoxLayout
;
//
layouth = new QHBoxLayout;
layouth1
=
new
QHBoxLayout
;
layouth2
=
new
QHBoxLayout
;
layouth3
=
new
QHBoxLayout
;
...
...
@@ -374,7 +396,7 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
layoutv
->
addLayout
(
layouth1
);
layoutv
->
addLayout
(
layouth2
);
layoutv
->
addLayout
(
layouth3
);
layoutv
->
addLayout
(
layouth
);
//
layoutv->addLayout(layouth);
layoutv
->
addLayout
(
layouth4
);
...
...
@@ -411,10 +433,12 @@ void NouveauModele::paramRegle(const QString& choix_regle) {
layouth4
->
addWidget
(
etatCourant
);
layouth4
->
addWidget
(
valid_Etat
);
layouth
->
addWidget
(
etat_d
);
layouth
->
addWidget
(
etat_default
);
//
layouth->addWidget(etat_d);
//
layouth->addWidget(etat_default);
connect
(
valid_Etat
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
choisirEtatCourant
(
const
QString
&
)));
}
else
{
}
}
...
...
@@ -462,22 +486,37 @@ void NouveauModele::validerParametrage(){
void
NouveauModele
::
changerRegle
(){
if
(
liste_regle_transition
!=
nullptr
)
delete
liste_regle_transition
;
if
(
liste_regle_transition
!=
nullptr
)
form_choix
->
removeRow
(
6
)
;
liste_regle_transition
=
new
QComboBox
;
liste_regle_transition
->
setPlaceholderText
(
"--- select ---"
);
//liste_regle_transition->addItem("--- select ---");
std
::
vector
<
QString
>
automates
=
Database
::
getInstance
().
getAutomates
();
/*
std::vector<QString> automates = Database::getInstance().getAutomates();
for(size_t i = 0 ; i<automates.size(); i++){
liste_regle_transition->addItem(automates[i]);
}
}*/
liste_regle_transition
->
addItem
(
"Game Life"
);
liste_regle_transition
->
addItem
(
"Nouvelle fonction de transition"
);
liste_regle_transition
->
setCurrentIndex
(
-
1
);
form_choix
->
add
Row
(
"Règle de transition : "
,
liste_regle_transition
);
form_choix
->
insert
Row
(
6
,
"Règle de transition : "
,
liste_regle_transition
);
connect
(
liste_regle_transition
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
changerVoisinage
(
const
QString
&
)));
connect
(
liste_regle_transition
,
SIGNAL
(
currentTextChanged
(
const
QString
&
)),
this
,
SLOT
(
paramRegle
(
const
QString
)));
}
void
NouveauModele
::
changerEtatDefault
(){
etat_default
=
new
QSpinBox
;
etat_default
->
setRange
(
0
,(
nb_etats
->
value
())
-
1
);
valider_EtatDefault
=
new
QPushButton
(
"Valider l'état de défaut"
);
form_choix
->
removeRow
(
6
);
form_choix
->
addRow
(
"Etat défaut : "
,
etat_default
);
form_choix
->
addRow
(
valider_EtatDefault
);
connect
(
valider_EtatDefault
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
parametrerEtats
()));
connect
(
valider_EtatDefault
,
SIGNAL
(
clicked
()),
this
,
SLOT
(
changerRegle
()));
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment