Don't allow editing read only params

This commit is contained in:
Michael Zanetti 2020-04-09 12:55:32 +02:00
parent 8a256d9bbb
commit 681dd19475
2 changed files with 2 additions and 2 deletions

View File

@ -54,7 +54,7 @@ public:
ReadOnlyRole ReadOnlyRole
}; };
explicit ParamTypes(QObject *parent = 0); explicit ParamTypes(QObject *parent = nullptr);
QList<ParamType *> paramTypes(); QList<ParamType *> paramTypes();

View File

@ -181,7 +181,6 @@ Page {
Component { Component {
id: discoveryParamsPage id: discoveryParamsPage
Page { Page {
id: discoveryParamsView id: discoveryParamsView
ColumnLayout { ColumnLayout {
@ -385,6 +384,7 @@ Page {
delegate: ParamDelegate { delegate: ParamDelegate {
// Layout.preferredHeight: 60 // Layout.preferredHeight: 60
Layout.fillWidth: true Layout.fillWidth: true
enabled: !model.readOnly
paramType: root.deviceClass.paramTypes.get(index) paramType: root.deviceClass.paramTypes.get(index)
value: d.deviceDescriptor && d.deviceDescriptor.params.getParam(paramType.id) ? value: d.deviceDescriptor && d.deviceDescriptor.params.getParam(paramType.id) ?
d.deviceDescriptor.params.getParam(paramType.id).value : d.deviceDescriptor.params.getParam(paramType.id).value :