Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
LO21_Pin_Noir_Boucher_Bouri_Detree
CellulutLO21
Commits
202e1d3c
Commit
202e1d3c
authored
May 20, 2021
by
Yann Boucher
Browse files
Merge branch 'master' of
https://gitlab.utc.fr/lo21_pin_noir_boucher_bouri_detree/cellulutlo21
parents
26f2bfc4
1f2d083d
Pipeline
#78240
passed with stages
in 17 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
forms/interface.ui
View file @
202e1d3c
...
...
@@ -347,41 +347,6 @@ pattern recorded :</string>
<string>
1
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
2
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
3
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
4
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
5
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
6
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
7
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
8
</string>
</property>
</item>
</widget>
</item>
</layout>
...
...
@@ -460,16 +425,6 @@ pattern recorded :</string>
</item>
<item
row=
"0"
column=
"1"
>
<widget
class=
"QComboBox"
name=
"nbrStatesComboBox"
>
<item>
<property
name=
"text"
>
<string>
0
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
1
</string>
</property>
</item>
<item>
<property
name=
"text"
>
<string>
2
</string>
...
...
@@ -569,7 +524,7 @@ pattern recorded :</string>
<x>
0
</x>
<y>
0
</y>
<width>
1089
</width>
<height>
2
5
</height>
<height>
2
6
</height>
</rect>
</property>
<widget
class=
"QMenu"
name=
"menuFichier"
>
...
...
include/interface.hpp
View file @
202e1d3c
...
...
@@ -54,6 +54,8 @@ private slots:
//! \brief Créer une nouvelle grille ayant des états aléatoire
void
on_randomPatternButton_clicked
();
void
on_nbrStatesComboBox_currentTextChanged
(
const
QString
&
arg1
);
private:
Ui
::
MainWindow
*
ui
;
};
...
...
src/interface.cpp
View file @
202e1d3c
...
...
@@ -189,3 +189,27 @@ void MainWindow::on_randomPatternButton_clicked()
ui
->
grid_view
->
copy_grid
(
newGrid
);
}
void
MainWindow
::
on_nbrStatesComboBox_currentTextChanged
(
const
QString
&
arg1
)
{
// Nombre d'états possibles
int
val
=
arg1
.
toInt
();
// Nombre de valeurs dans le comboxBox (en partant de 0)
int
currentNbrValue
=
ui
->
nbrStateComboBox
->
count
();
// Si on change le nbr d'états
if
(
val
!=
currentNbrValue
)
{
// Si on ajoute des états
if
(
val
>
currentNbrValue
)
{
for
(
int
i
=
currentNbrValue
;
i
<
val
;
i
++
)
{
ui
->
nbrStateComboBox
->
addItem
(
QString
::
number
(
i
));
}
}
// Si on retire des états
else
{
for
(
int
i
=
currentNbrValue
-
1
;
i
>=
val
;
i
--
)
{
ui
->
nbrStateComboBox
->
removeItem
(
i
);
}
}
}
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a 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