Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
P
Projet_sudoku
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jolibois Simon
Projet_sudoku
Commits
fd00fe81
Commit
fd00fe81
authored
4 years ago
by
Jolibois Simon
Browse files
Options
Downloads
Patches
Plain Diff
nettoyage du code et ajout de commentaires
parent
4e61b225
No related branches found
No related tags found
No related merge requests found
Changes
5
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
Resultat.qml
+14
-14
14 additions, 14 deletions
Resultat.qml
debug/qrc_qml.cpp
+220
-209
220 additions, 209 deletions
debug/qrc_qml.cpp
debug/qrc_qml.o
+0
-0
0 additions, 0 deletions
debug/qrc_qml.o
debug/sudoku.exe
+0
-0
0 additions, 0 deletions
debug/sudoku.exe
main.qml
+221
-215
221 additions, 215 deletions
main.qml
with
455 additions
and
438 deletions
Resultat.qml
+
14
−
14
View file @
fd00fe81
This diff is collapsed.
Click to expand it.
debug/qrc_qml.cpp
+
220
−
209
View file @
fd00fe81
This diff is collapsed.
Click to expand it.
debug/qrc_qml.o
+
0
−
0
View file @
fd00fe81
No preview for this file type
This diff is collapsed.
Click to expand it.
debug/sudoku.exe
+
0
−
0
View file @
fd00fe81
No preview for this file type
This diff is collapsed.
Click to expand it.
main.qml
+
221
−
215
View file @
fd00fe81
...
...
@@ -12,7 +12,12 @@ Window {
color
:
"
#e6ecfa
"
function
check
(){
/* appelle la fonction verif_matrice vérifie que la grille est correcte */
// appel de la fonction verif_matrice
vueObjetCpt
.
verif_matrice
();
// signal de retour et affichage de la fenêtre Résultat
var
verif
=
vueObjetCpt
.
verifier
;
if
(
verif
===
1
){
result
.
visible
=
true
;
...
...
@@ -26,7 +31,12 @@ Window {
}
function
save_clicked
(){
/* appelle la fonction save_grid et enregistre la partie actuelle */
// appel de la fonction save_grid
vueObjetCpt
.
save_grid
();
// signal de retour et confirmation visuelle de la sauvegarde - pas fonctionnelle pour l'instant
var
isSaved
=
vueObjetCpt
.
gameIsSaved
();
if
(
isSaved
===
1
){
saved_display
.
visible
=
true
;
...
...
@@ -38,13 +48,16 @@ Window {
}
function
set_chiffre_actif
(
i
){
/* appelle la fonction changer_valeur_bouton et change la valeur d'une case à partir de boutons */
// appel de la fonction changer_valeur_bouton
vueObjetCpt
.
changer_valeur_bouton
(
i
);
// signal de retour
var
chiffre_IsActif
=
vueObjetCpt
.
coloration
var
values
=
vueObjetCpt
.
values
;
var
l
var
c
for
(
l
=
0
;
l
<
9
;
l
++
){
for
(
c
=
0
;
c
<
9
;
c
++
){
for
(
var
l
=
0
;
l
<
9
;
l
++
){
for
(
var
c
=
0
;
c
<
9
;
c
++
){
var
v
=
repeater
.
itemAt
(
l
).
rep
.
itemAt
(
c
).
input
v
.
text
=
values
[
l
][
c
];
}
...
...
@@ -53,8 +66,7 @@ Window {
Component.onCompleted
:{
var
values
=
vueObjetCpt
.
values
;
var
i
;
for
(
i
=
0
;
i
<
9
;
i
++
){
for
(
var
i
=
0
;
i
<
9
;
i
++
){
var
t
=
repeater
.
itemAt
(
0
).
rep
.
itemAt
(
i
).
input
t
.
text
=
values
[
0
][
i
]
if
(
values
[
0
][
i
]
!==
''
){
...
...
@@ -136,15 +148,17 @@ Window {
}
}
}
property
alias
repeater
:
repeater
MenuBar
{
id
:
menuBar
Menu
{
title
:
qsTr
(
"
File
"
)
Action
{
text
:
qsTr
(
"
New File
"
)}
Action
{
text
:
qsTr
(
"
Save current game
"
)
onTriggered
:
save_clicked
()}
Action
{
text
:
qsTr
(
"
Open game
"
)}
}
delegate
:
MenuBarItem
{
...
...
@@ -170,26 +184,20 @@ Window {
}
background
:
Rectangle
{
// rectangle du menu
id
:
menu_background
implicitWidth
:
40
implicitHeight
:
40
color
:
"
#ffffff
"
// border.width: 1
// border.color: "#000000"
Rectangle
{
// la barre noire en dessous du menu
color
:
"
#000000
"
width
:
parent
.
width
height
:
1
anchors.bottom
:
parent
.
bottom
height
:
1
}
}
}
Rectangle
{
id
:
background
x
:
3
...
...
@@ -201,7 +209,6 @@ Window {
width
:
childrenRect
.
width
+
6
height
:
childrenRect
.
height
+
6
Grid
{
id
:
grid
x
:
3
...
...
@@ -209,6 +216,7 @@ Window {
rows
:
3
columns
:
3
spacing
:
2
Repeater
{
id
:
repeater
model
:
9
...
...
@@ -228,17 +236,15 @@ Window {
y
:
660
width
:
132
height
:
40
text
:
qsTr
(
"
Vérifier la grille
"
)
anchors.bottom
:
parent
.
bottom
highlighted
:
false
anchors.horizontalCenterOffset
:
-
250
anchors.horizontalCenter
:
parent
.
horizontalCenter
anchors.horizontalCenterOffset
:
-
250
anchors.bottom
:
parent
.
bottom
anchors.bottomMargin
:
10
text
:
qsTr
(
"
Vérifier la grille
"
)
highlighted
:
false
font.weight
:
Font
.
ExtraLight
font.pointSize
:
12
onClicked
:{
check
();
button_check
.
highlighted
=
true
}
onClicked
:
{
check
();
button_check
.
highlighted
=
true
}
}
Resultat
{
...
...
@@ -411,8 +417,8 @@ Window {
Rectangle
{
id
:
saved_display
visible
:
false
width
:
child
.
width
height
:
child
.
height
width
:
child
renRect
.
width
height
:
child
renRect
.
height
anchors.bottom
:
parent
.
bottom
anchors.horizontalCenter
:
parent
.
left
anchors.bottomMargin
:
40
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment