Добавил форму настроек

This commit is contained in:
2018-07-11 20:44:50 +02:00
parent f2f55a2830
commit 34637319ba
3 changed files with 58 additions and 4 deletions

View File

@@ -2,10 +2,56 @@ import QtQuick 2.0
import QtQuick.Controls 2.2
Page {
id: root
title: qsTr("Settings")
Label {
text: qsTr("You are on Settings Page")
anchors.centerIn: parent
ListModel {
id: settingsModel
ListElement {
name: "serviceUrl"
title: qsTr("NooLite service URL:")
inputHint: Qt.ImhUrlCharactersOnly
}
}
ListView {
model: settingsModel
anchors.fill: parent
anchors.margins: 8
delegate: Item {
id: settingsItem
width: parent.width
height: childrenRect.height
Label {
id: titleLabel
anchors.left: settingsItem.left
anchors.verticalCenter: valueField.verticalCenter
text: model.title
}
TextField {
id: valueField
anchors.right: settingsItem.right
anchors.left: titleLabel.right
anchors.leftMargin: 8
inputMethodHints: model.inputHint
text: settings[model.name]
onTextChanged: {
settings[model.name] = text
}
}
}
}
}