From 4e61b22561cbc814ff13afe7e70e85fde7ef8626 Mon Sep 17 00:00:00 2001 From: Simon Jolibois <simon.jolibois@ecl19.ec-lyon.fr> Date: Fri, 9 Apr 2021 18:20:39 +0200 Subject: [PATCH] nettoyage du code et ajout de commentaires --- Carre.qml | 29 +++++++++++++++-------------- Resultat.qml | 8 ++++---- main.qml | 2 +- 3 files changed, 20 insertions(+), 19 deletions(-) diff --git a/Carre.qml b/Carre.qml index 6c0697d..2891f52 100644 --- a/Carre.qml +++ b/Carre.qml @@ -63,8 +63,11 @@ Item { Grid{ id : grid - x: 3; y:3 - rows:3; columns:3; spacing :2 + x : 3 + y : 3 + rows : 3 + columns : 3 + spacing : 2 Repeater{ id : repeater1 @@ -78,19 +81,17 @@ Item { border.color : "#000000" TextInput{ - id:input - color:'#333333' + id : input + readOnly : false width : parent.width - height:parent.height - horizontalAlignment: Text.AlignHCenter - verticalAlignment: Text.AlignVCenter - readOnly: false - font.pointSize: 24 - maximumLength: 1 - validator: RegExpValidator { regExp: /[1-9]+/ } - onFocusChanged: { - changer_couleur(this, focus) - } + height : parent.height + horizontalAlignment : Text.AlignHCenter + verticalAlignment : Text.AlignVCenter + font.pointSize : 24 + maximumLength : 1 + color :'#333333' + validator : RegExpValidator { regExp: /[1-9]+/ } + onFocusChanged : {changer_couleur(this, focus)} onTextEdited : envoyer_valeur(this) } } diff --git a/Resultat.qml b/Resultat.qml index 89410ec..94b6c1c 100644 --- a/Resultat.qml +++ b/Resultat.qml @@ -4,9 +4,9 @@ import QtQuick.Layouts 1.1 import QtQuick.Controls 2.15 Window { + visible: true width: 700 height: 200 - visible: true title: qsTr("Résultat") property alias rectangle : rectangle @@ -19,12 +19,12 @@ Window { Text { id: text1 text: "Text" - anchors.fill: parent font.pixelSize: 30 + font.family: "Tahoma" + anchors.fill: parent horizontalAlignment: Text.AlignHCenter verticalAlignment: Text.AlignVCenter - font.pointSize: 16 - font.family: "Tahoma" + } } } diff --git a/main.qml b/main.qml index b55798d..4c810ca 100644 --- a/main.qml +++ b/main.qml @@ -5,11 +5,11 @@ import QtQuick.Controls 2.15 Window { id : root - color: "#e6ecfa" width: 655 height: 717 visible: true title: qsTr("Sudoku") + color: "#e6ecfa" function check(){ vueObjetCpt.verif_matrice(); -- GitLab