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
b1033c38
Commit
b1033c38
authored
Jun 09, 2021
by
Maxime Goret
Browse files
modif parametrage
parent
6167f176
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/parametragemodele.cpp
View file @
b1033c38
...
...
@@ -127,24 +127,37 @@ void NouveauModele::affGrille() {
*/
grid
->
setItem
(
i
,
j
,
new
QTableWidgetItem
);
grid
->
item
(
i
,
j
)
->
setFlags
(
Qt
::
ItemIsEnabled
);
grid
->
item
(
i
,
j
)
->
setFlags
(
Qt
::
ItemIsEnabled
);
grid
->
item
(
i
,
j
)
->
setBackground
(
Qt
::
white
);
}
}
}
QColor
noir
=
Qt
::
black
;
grid
->
item
(
2
,
2
)
->
setBackground
(
noir
);
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
;
QColor
blanc
=
Qt
::
white
;
if
(
i
==
2
&&
j
==
2
){
return
;
}
else
grid
->
item
(
i
,
j
)
->
setBackground
(
rouge
);
return
;
}
else
if
(
grid
->
item
(
i
,
j
)
->
background
()
==
blanc
){
grid
->
item
(
i
,
j
)
->
setBackground
(
rouge
);
}
else
if
(
grid
->
item
(
i
,
j
)
->
background
()
==
rouge
){
grid
->
item
(
i
,
j
)
->
setBackground
(
blanc
);
}
}
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