Files
scheincommander/DeviceTypesSettingsPage.qml
T

84 lines
2.8 KiB
QML
Raw Normal View History

2023-02-15 01:12:19 +01:00
import QtQuick
import QtQuick.Controls.Material
import QtQuick.Layouts
import com.büro 1.0
2023-02-15 01:12:19 +01:00
ColumnLayout {
Label {
text: qsTr("Device Types Settings")
}
RowLayout {
//Layout.fillWidth: true
Layout.fillHeight: true
EditableListView {
id: listView
2023-02-15 01:12:19 +01:00
Layout.preferredWidth: 300
Layout.maximumWidth: 300
Layout.fillHeight: true
model: deviceTypesModel
onAddClicked: (index) => deviceTypesModel.insertRow(index < 0 ? 0 : index + 1);
2023-02-15 01:12:19 +01:00
onRemoveClicked: (index) => deviceTypesModel.removeRow(index)
}
ColumnLayout {
enabled: listView.currentIndex !== -1
2023-02-15 01:12:19 +01:00
GridLayout {
2023-02-15 22:27:57 +01:00
Layout.preferredWidth: 600
Layout.maximumWidth: 600
2023-02-15 01:12:19 +01:00
columns: 2
Label { text: qsTr("Id:") }
SpinBox {
2023-02-15 22:27:57 +01:00
enabled: false
2023-02-15 01:12:19 +01:00
Layout.fillWidth: true
value: listView.currentData.id
onValueModified: listView.currentData.id = value
2023-02-15 01:12:19 +01:00
}
Label { text: qsTr("Name:") }
TextField {
Layout.fillWidth: true
text: listView.currentData.name
onTextEdited: listView.currentData.name = text
2023-02-15 01:12:19 +01:00
}
2023-02-18 18:45:32 +01:00
Label { text: qsTr("Icon:") }
ComboBox {
Layout.fillWidth: true
id: iconCombobox
//textRole: "imageSource"
//valueRole: "imageSource"
//currentIndex: iconCombobox.indexOfValue(listView.currentData.deviceTypeId)
//onActivated: if (listView.currentData) listView.currentData.deviceTypeId = currentValue; else console.warn('discarded');
delegate: Image {
height: 64
fillMode: Image.PreserveAspectFit
source: imageSource
}
model: ListModel {
id: cbItems
2023-02-18 18:58:42 +01:00
ListElement { imageSource: "qrc:/lightcontrol/icons/movinghead.png" }
ListElement { imageSource: "qrc:/lightcontrol/icons/nebelmaschine.png" }
ListElement { imageSource: "qrc:/lightcontrol/icons/rgbstrahler.png" }
2023-02-18 18:45:32 +01:00
}
}
2023-02-15 01:12:19 +01:00
Label { text: qsTr("Registers:") }
RegistersSettingsItem {
2023-02-15 01:12:19 +01:00
Layout.fillWidth: true
Layout.fillHeight: true
deviceTypeId: listView.currentData.id
2023-02-15 01:12:19 +01:00
}
}
Item {
Layout.fillHeight: true
}
}
}
}