Make the main view functional
This commit is contained in:
+34
-9
@@ -1,13 +1,38 @@
|
||||
import QtQuick 2.5
|
||||
|
||||
ListModel {
|
||||
ListElement {
|
||||
name: "Server"
|
||||
}
|
||||
ListElement {
|
||||
name: "Username"
|
||||
}
|
||||
ListElement {
|
||||
name: "Password"
|
||||
Column {
|
||||
anchors.fill: parent
|
||||
anchors.margins: 20
|
||||
spacing: 15
|
||||
|
||||
// Repeater pour générer les champs basés sur la liste des labels et types
|
||||
Repeater {
|
||||
model: fields
|
||||
|
||||
Row {
|
||||
width: parent.width
|
||||
spacing: 10
|
||||
|
||||
Text {
|
||||
text: modelData.label + ":"
|
||||
width: 100
|
||||
color: "white"
|
||||
verticalAlignment: Text.AlignVCenter
|
||||
font.pixelSize: 16
|
||||
}
|
||||
|
||||
// TextInput pour les champs Server et User, et mode Password pour Password
|
||||
TextInput {
|
||||
width: parent.width - 110
|
||||
height: 30
|
||||
font.pixelSize: 16
|
||||
color: "white"
|
||||
text: modelData.label
|
||||
|
||||
// Détermine le mode de saisie en fonction du type
|
||||
echoMode: modelData.type === "password" ? TextInput.Password : TextInput.Normal
|
||||
//echoMode: TextInput.Password
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user