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
7d5412e6
Commit
7d5412e6
authored
Jun 08, 2021
by
Luning Yang
Browse files
changemant de couleur d'une cellule cliquée
parent
76b565ca
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parametragemodele.cpp
View file @
7d5412e6
...
...
@@ -92,10 +92,10 @@ void NouveauModele::paramVoisinage(const QString& choix_voisinage){
else
if
(
choix_voisinage
==
"Voisinage arbitraire"
)
{
this
->
affGrille
();
}
//
else if(choix_voisinage == "--- select ---"){
else
if
(
choix_voisinage
==
"--- select ---"
){
//delete form_rayon;
//delete grid;
//
}
}
}
...
...
@@ -114,9 +114,33 @@ void NouveauModele::affGrille() {
{
grid
->
setRowHeight
(
j
,
80
);
grid
->
setColumnWidth
(
j
,
80
);
/*
int x = i-3;
int y = -1*(j-2);
std::string co = "(";
co += x;
co += ",";
co += y;
co += ")";
QString coordonnees = co;
*/
grid
->
setItem
(
i
,
j
,
new
QTableWidgetItem
);
grid
->
item
(
i
,
j
)
->
setFlags
(
Qt
::
ItemIsEnabled
);
}
}
connect
(
grid
,
SIGNAL
(
clicked
(
const
QModelIndex
&
)),
this
,
SLOT
(
modifGrille
(
const
QModelIndex
&
)));
}
void
NouveauModele
::
modifGrille
(
const
QModelIndex
&
index
){
unsigned
int
i
=
index
.
row
();
unsigned
int
j
=
index
.
column
();
QColor
rouge
=
Qt
::
red
;
grid
->
item
(
i
,
j
)
->
setBackground
(
rouge
);
}
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