forked from qt-creator/qt-creator
EffectComposer: Fix qml warnings
Change-Id: I40abc68800b95888edae0450625f20d51fd8ed74 Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io> Reviewed-by: <github-actions-qt-creator@cristianadam.eu> Reviewed-by: Mahmoud Badri <mahmoud.badri@qt.io>
This commit is contained in:
@@ -185,7 +185,7 @@ ColumnLayout {
|
|||||||
style: StudioTheme.Values.viewBarButtonStyle
|
style: StudioTheme.Values.viewBarButtonStyle
|
||||||
buttonIcon: StudioTheme.Constants.clearList_medium
|
buttonIcon: StudioTheme.Constants.clearList_medium
|
||||||
tooltip: qsTr("Remove all effect nodes.")
|
tooltip: qsTr("Remove all effect nodes.")
|
||||||
enabled: !root.backendModel.isEmpty
|
enabled: root.backendModel ? !root.backendModel.isEmpty : false
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (root.backendModel.hasUnsavedChanges)
|
if (root.backendModel.hasUnsavedChanges)
|
||||||
@@ -296,14 +296,16 @@ ColumnLayout {
|
|||||||
} // ScrollView
|
} // ScrollView
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
text: root.backendModel.isEnabled ? qsTr("Add an effect node to start")
|
text: root.backendModel ? root.backendModel.isEnabled
|
||||||
: qsTr("Effect Composer is disabled on MCU projects")
|
? qsTr("Add an effect node to start")
|
||||||
|
: qsTr("Effect Composer is disabled on MCU projects")
|
||||||
|
: ""
|
||||||
color: StudioTheme.Values.themeTextColor
|
color: StudioTheme.Values.themeTextColor
|
||||||
font.pixelSize: StudioTheme.Values.baseFontSize
|
font.pixelSize: StudioTheme.Values.baseFontSize
|
||||||
|
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|
||||||
visible: root.backendModel.isEmpty
|
visible: root.backendModel ? root.backendModel.isEmpty : false
|
||||||
}
|
}
|
||||||
} // Item
|
} // Item
|
||||||
} // Column
|
} // Column
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ Rectangle {
|
|||||||
style: StudioTheme.Values.viewBarButtonStyle
|
style: StudioTheme.Values.viewBarButtonStyle
|
||||||
buttonIcon: StudioTheme.Constants.add_medium
|
buttonIcon: StudioTheme.Constants.add_medium
|
||||||
tooltip: qsTr("Add new composition")
|
tooltip: qsTr("Add new composition")
|
||||||
enabled: root.backendModel.isEnabled
|
enabled: root.backendModel ? root.backendModel.isEnabled : false
|
||||||
onClicked: root.addClicked()
|
onClicked: root.addClicked()
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -36,8 +36,10 @@ Rectangle {
|
|||||||
style: StudioTheme.Values.viewBarButtonStyle
|
style: StudioTheme.Values.viewBarButtonStyle
|
||||||
buttonIcon: StudioTheme.Constants.save_medium
|
buttonIcon: StudioTheme.Constants.save_medium
|
||||||
tooltip: qsTr("Save current composition")
|
tooltip: qsTr("Save current composition")
|
||||||
enabled: root.backendModel.isEnabled && (root.backendModel.hasUnsavedChanges
|
enabled: root.backendModel ? root.backendModel.isEnabled
|
||||||
|| root.backendModel.currentComposition === "")
|
&& (root.backendModel.hasUnsavedChanges
|
||||||
|
|| root.backendModel.currentComposition === "")
|
||||||
|
: false
|
||||||
|
|
||||||
onClicked: root.saveClicked()
|
onClicked: root.saveClicked()
|
||||||
}
|
}
|
||||||
@@ -46,7 +48,8 @@ Rectangle {
|
|||||||
style: StudioTheme.Values.viewBarButtonStyle
|
style: StudioTheme.Values.viewBarButtonStyle
|
||||||
buttonIcon: StudioTheme.Constants.saveAs_medium
|
buttonIcon: StudioTheme.Constants.saveAs_medium
|
||||||
tooltip: qsTr("Save current composition with a new name")
|
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()
|
onClicked: root.saveAsClicked()
|
||||||
}
|
}
|
||||||
@@ -55,7 +58,9 @@ Rectangle {
|
|||||||
style: StudioTheme.Values.viewBarButtonStyle
|
style: StudioTheme.Values.viewBarButtonStyle
|
||||||
buttonIcon: StudioTheme.Constants.assignTo_medium
|
buttonIcon: StudioTheme.Constants.assignTo_medium
|
||||||
tooltip: qsTr("Assign current composition to selected item")
|
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()
|
onClicked: root.assignToSelectedClicked()
|
||||||
}
|
}
|
||||||
@@ -63,7 +68,8 @@ Rectangle {
|
|||||||
|
|
||||||
|
|
||||||
Text {
|
Text {
|
||||||
readonly property string compName: root.backendModel.currentComposition
|
readonly property string compName: root.backendModel ? root.backendModel.currentComposition
|
||||||
|
: ""
|
||||||
|
|
||||||
text: compName !== "" ? compName : qsTr("Untitled")
|
text: compName !== "" ? compName : qsTr("Untitled")
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
|
|||||||
Reference in New Issue
Block a user