Исправлена структура каталогов

This commit is contained in:
2024-05-16 16:26:38 +02:00
parent 53659cea38
commit fe298f0631
17 changed files with 22 additions and 66 deletions

View File

@@ -0,0 +1,64 @@
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")
inputMethodHint: Qt.ImhUrlCharactersOnly
}
}
ListView {
model: settingsModel
anchors.fill: parent
delegate: SubtitledItemDelegate {
width: parent.width
text: model.title
subtitle: settings[model.name]
onClicked: inputDialog.open()
Dialog {
id: inputDialog
x: (parent.width - width) / 2
y: (parent.height - height) / 2
parent: ApplicationWindow.overlay
focus: true
modal: true
title: model.title
standardButtons: Dialog.Ok | Dialog.Cancel
Column {
spacing: 20
anchors.fill: parent
TextField {
id: textField
width: parent.width
focus: true
inputMethodHints: Qt.ImhNoAutoUppercase | model.inputMethodHint
placeholderText: model.title
text: settings[model.name]
}
}
onAccepted: {
settings[model.name] = textField.text
}
}
}
}
}