Files
scheincommander/DeviceTypesSettingsPage.qml
T

113 lines
3.3 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 {
2023-02-15 22:27:57 +01:00
id: deviceTypesListView
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 {
2023-02-15 22:27:57 +01:00
enabled: deviceTypesListView.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
2023-02-15 22:27:57 +01:00
value: deviceTypesListView.currentData.id
onValueModified: deviceTypesListView.currentData.id = value
2023-02-15 01:12:19 +01:00
}
Label { text: qsTr("Name:") }
TextField {
Layout.fillWidth: true
2023-02-15 22:27:57 +01:00
text: deviceTypesListView.currentData.name
onTextEdited: deviceTypesListView.currentData.name = text
2023-02-15 01:12:19 +01:00
}
Label { text: qsTr("Registers:") }
Pane {
Layout.fillWidth: true
Layout.fillHeight: true
2023-02-15 22:27:57 +01:00
Material.elevation: 6
RowLayout {
anchors.fill: parent
Pane {
Layout.preferredWidth: 300
Layout.fillHeight: true
Material.elevation: 6
EditableListView {
id: deviceTypesRegistersListView
anchors.fill: parent
textRole: 'registerTypeName'
model: DeviceTypeRegistersModel {
controller: __controller
deviceTypeId: deviceTypesListView.currentData.id
}
}
}
2023-02-15 22:27:57 +01:00
ColumnLayout {
Layout.fillWidth: true
Layout.fillHeight: true
enabled: deviceTypesRegistersListView.currentIndex >= 0
GridLayout {
Layout.fillWidth: true
columns: 2
Label {
text: qsTr('Type:')
}
ComboBox {
}
}
Item {
Layout.fillWidth: true
Layout.fillHeight: true
}
}
2023-02-15 01:12:19 +01:00
}
}
}
Item {
Layout.fillHeight: true
}
}
}
}