diff --git a/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposer.qml b/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposer.qml index af1c16491e0..dda1d93ff96 100644 --- a/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposer.qml +++ b/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposer.qml @@ -185,7 +185,7 @@ ColumnLayout { style: StudioTheme.Values.viewBarButtonStyle buttonIcon: StudioTheme.Constants.clearList_medium tooltip: qsTr("Remove all effect nodes.") - enabled: !root.backendModel.isEmpty + enabled: root.backendModel ? !root.backendModel.isEmpty : false onClicked: { if (root.backendModel.hasUnsavedChanges) @@ -296,14 +296,16 @@ ColumnLayout { } // ScrollView Text { - text: root.backendModel.isEnabled ? qsTr("Add an effect node to start") - : qsTr("Effect Composer is disabled on MCU projects") + text: root.backendModel ? root.backendModel.isEnabled + ? qsTr("Add an effect node to start") + : qsTr("Effect Composer is disabled on MCU projects") + : "" color: StudioTheme.Values.themeTextColor font.pixelSize: StudioTheme.Values.baseFontSize anchors.centerIn: parent - visible: root.backendModel.isEmpty + visible: root.backendModel ? root.backendModel.isEmpty : false } } // Item } // Column diff --git a/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposerTopBar.qml b/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposerTopBar.qml index c01bc6dc992..d5ac4461c48 100644 --- a/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposerTopBar.qml +++ b/share/qtcreator/qmldesigner/effectComposerQmlSources/EffectComposerTopBar.qml @@ -28,7 +28,7 @@ Rectangle { style: StudioTheme.Values.viewBarButtonStyle buttonIcon: StudioTheme.Constants.add_medium tooltip: qsTr("Add new composition") - enabled: root.backendModel.isEnabled + enabled: root.backendModel ? root.backendModel.isEnabled : false onClicked: root.addClicked() } @@ -36,8 +36,10 @@ Rectangle { style: StudioTheme.Values.viewBarButtonStyle buttonIcon: StudioTheme.Constants.save_medium tooltip: qsTr("Save current composition") - enabled: root.backendModel.isEnabled && (root.backendModel.hasUnsavedChanges - || root.backendModel.currentComposition === "") + enabled: root.backendModel ? root.backendModel.isEnabled + && (root.backendModel.hasUnsavedChanges + || root.backendModel.currentComposition === "") + : false onClicked: root.saveClicked() } @@ -46,7 +48,8 @@ Rectangle { style: StudioTheme.Values.viewBarButtonStyle buttonIcon: StudioTheme.Constants.saveAs_medium tooltip: qsTr("Save current composition with a new name") - enabled: root.backendModel.isEnabled && !root.backendModel.isEmpty + enabled: root.backendModel ? root.backendModel.isEnabled && !root.backendModel.isEmpty + : false onClicked: root.saveAsClicked() } @@ -55,7 +58,9 @@ Rectangle { style: StudioTheme.Values.viewBarButtonStyle buttonIcon: StudioTheme.Constants.assignTo_medium tooltip: qsTr("Assign current composition to selected item") - enabled: root.backendModel.isEnabled && root.backendModel.currentComposition !== "" + enabled: root.backendModel ? root.backendModel.isEnabled + && root.backendModel.currentComposition !== "" + : false onClicked: root.assignToSelectedClicked() } @@ -63,7 +68,8 @@ Rectangle { Text { - readonly property string compName: root.backendModel.currentComposition + readonly property string compName: root.backendModel ? root.backendModel.currentComposition + : "" text: compName !== "" ? compName : qsTr("Untitled") anchors.centerIn: parent