Добавил форму настроек
This commit is contained in:
@@ -5,7 +5,7 @@ Page {
|
||||
title: qsTr("Home")
|
||||
|
||||
Label {
|
||||
text: qsTr("You are on the home page.")
|
||||
text: qsTr("You are on the home page. " + settings.serviceUrl)
|
||||
anchors.centerIn: parent
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,10 +2,56 @@ import QtQuick 2.0
|
||||
import QtQuick.Controls 2.2
|
||||
|
||||
Page {
|
||||
id: root
|
||||
|
||||
title: qsTr("Settings")
|
||||
|
||||
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 {
|
||||
text: qsTr("You are on Settings Page")
|
||||
anchors.centerIn: parent
|
||||
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
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user