Avoid qml errors on shutdown

This commit is contained in:
2023-02-18 21:31:59 +01:00
parent 5493e21f40
commit 79aca207c4

View File

@@ -69,13 +69,13 @@ ColumnLayout {
SpinBox { SpinBox {
enabled: false enabled: false
Layout.fillWidth: true Layout.fillWidth: true
value: listView.currentData.id value: listView.currentData ? listView.currentData.id : -1
onValueModified: listView.currentData.id = value onValueModified: listView.currentData.id = value
} }
Label { text: qsTr("Name:") } Label { text: qsTr("Name:") }
TextField { TextField {
Layout.fillWidth: true Layout.fillWidth: true
text: listView.currentData.name text: listView.currentData ? listView.currentData.name : ''
onTextEdited: listView.currentData.name = text onTextEdited: listView.currentData.name = text
} }
Label { text: qsTr("Icon:") } Label { text: qsTr("Icon:") }
@@ -103,7 +103,7 @@ ColumnLayout {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
deviceTypeId: listView.currentData.id deviceTypeId: listView.currentData ? listView.currentData.id : -1
} }
} }
Item { Item {