58 lines
1.1 KiB
QML
58 lines
1.1 KiB
QML
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 {
|
|
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: 10
|
|
|
|
inputMethodHints: model.inputHint
|
|
|
|
text: settings[model.name]
|
|
|
|
onTextChanged: {
|
|
settings[model.name] = text
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|