| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657 |
- 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: 8
- inputMethodHints: model.inputHint
- text: settings[model.name]
- onTextChanged: {
- settings[model.name] = text
- }
- }
- }
- }
- }
|