forked from qt-creator/qt-creator
QmlDesigner: Fix some warnings on startup
Those warnings are thrown because some backend values aren't initially available. Change-Id: I65858c5ed9dc1701446d6a37237d4135d8d6942e Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
326b7ba079
commit
6b8964071a
@@ -25,7 +25,7 @@ Section {
|
|||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
backendValue: backendValues.enabled
|
backendValue: backendValues.enabled
|
||||||
text: backendValues.enabled.valueToString
|
text: backendValues.enabled?.valueToString
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -34,7 +34,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Smooth")
|
text: qsTr("Smooth")
|
||||||
tooltip: qsTr("Toggles if the smoothing is performed using linear interpolation method. Keeping it unchecked would follow non-smooth method using nearest neighbor. It is mostly applicable on image based items.")
|
tooltip: qsTr("Toggles if the smoothing is performed using linear interpolation method. Keeping it unchecked would follow non-smooth method using nearest neighbor. It is mostly applicable on image based items.")
|
||||||
blockedByTemplate: !backendValues.smooth.isAvailable
|
blockedByTemplate: !backendValues.smooth?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -42,8 +42,8 @@ Section {
|
|||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
backendValue: backendValues.smooth
|
backendValue: backendValues.smooth
|
||||||
text: backendValues.smooth.valueToString
|
text: backendValues.smooth?.valueToString
|
||||||
enabled: backendValues.smooth.isAvailable
|
enabled: backendValues.smooth?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -52,7 +52,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Antialiasing")
|
text: qsTr("Antialiasing")
|
||||||
tooltip: qsTr("Refines the edges of the image.")
|
tooltip: qsTr("Refines the edges of the image.")
|
||||||
blockedByTemplate: !backendValues.antialiasing.isAvailable
|
blockedByTemplate: !backendValues.antialiasing?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -60,8 +60,8 @@ Section {
|
|||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
backendValue: backendValues.antialiasing
|
backendValue: backendValues.antialiasing
|
||||||
text: backendValues.antialiasing.valueToString
|
text: backendValues.antialiasing?.valueToString
|
||||||
enabled: backendValues.antialiasing.isAvailable
|
enabled: backendValues.antialiasing?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -70,7 +70,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Focus")
|
text: qsTr("Focus")
|
||||||
tooltip: qsTr("Sets focus on the component within the enclosing focus scope.")
|
tooltip: qsTr("Sets focus on the component within the enclosing focus scope.")
|
||||||
blockedByTemplate: !backendValues.focus.isAvailable
|
blockedByTemplate: !backendValues.focus?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -78,8 +78,8 @@ Section {
|
|||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
backendValue: backendValues.focus
|
backendValue: backendValues.focus
|
||||||
text: backendValues.focus.valueToString
|
text: backendValues.focus?.valueToString
|
||||||
enabled: backendValues.focus.isAvailable
|
enabled: backendValues.focus?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -88,7 +88,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Focus on tab")
|
text: qsTr("Focus on tab")
|
||||||
tooltip: qsTr("Adds the component to the tab focus chain.")
|
tooltip: qsTr("Adds the component to the tab focus chain.")
|
||||||
blockedByTemplate: !backendValues.activeFocusOnTab.isAvailable
|
blockedByTemplate: !backendValues.activeFocusOnTab?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -96,8 +96,8 @@ Section {
|
|||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
backendValue: backendValues.activeFocusOnTab
|
backendValue: backendValues.activeFocusOnTab
|
||||||
text: backendValues.activeFocusOnTab.valueToString
|
text: backendValues.activeFocusOnTab?.valueToString
|
||||||
enabled: backendValues.activeFocusOnTab.isAvailable
|
enabled: backendValues.activeFocusOnTab?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -106,7 +106,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Baseline offset")
|
text: qsTr("Baseline offset")
|
||||||
tooltip: qsTr("Sets the position of the component's baseline in local coordinates.")
|
tooltip: qsTr("Sets the position of the component's baseline in local coordinates.")
|
||||||
blockedByTemplate: !backendValues.baselineOffset.isAvailable
|
blockedByTemplate: !backendValues.baselineOffset?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -119,7 +119,7 @@ Section {
|
|||||||
decimals: 0
|
decimals: 0
|
||||||
minimumValue: -1000
|
minimumValue: -1000
|
||||||
maximumValue: 1000
|
maximumValue: 1000
|
||||||
enabled: backendValues.baselineOffset.isAvailable
|
enabled: backendValues.baselineOffset?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
|
@@ -40,7 +40,7 @@ Section {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
caption: qsTr('Effects <a style="color:%1;">[beta]</a>').arg(StudioTheme.Values.themeInteraction)
|
caption: qsTr('Effects <a style="color:%1;">[beta]</a>').arg(StudioTheme.Values.themeInteraction)
|
||||||
visible: backendValues.layer_effect.isAvailable
|
visible: backendValues.layer_effect?.isAvailable ?? false
|
||||||
|
|
||||||
property Connections connection: Connections {
|
property Connections connection: Connections {
|
||||||
target: modelNodeBackend
|
target: modelNodeBackend
|
||||||
|
@@ -161,7 +161,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Rotation")
|
text: qsTr("Rotation")
|
||||||
tooltip: qsTr("Rotate the component at an angle.")
|
tooltip: qsTr("Rotate the component at an angle.")
|
||||||
blockedByTemplate: !backendValues.rotation.isAvailable
|
blockedByTemplate: !backendValues.rotation?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -173,7 +173,7 @@ Section {
|
|||||||
decimals: 2
|
decimals: 2
|
||||||
minimumValue: -360
|
minimumValue: -360
|
||||||
maximumValue: 360
|
maximumValue: 360
|
||||||
enabled: backendValues.rotation.isAvailable
|
enabled: backendValues.rotation?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
||||||
@@ -181,7 +181,7 @@ Section {
|
|||||||
ControlLabel {
|
ControlLabel {
|
||||||
text: "°"
|
text: "°"
|
||||||
tooltip: rotationSpinBox.enabled ? qsTr("Angle (in degree)") : root.disabledTooltip
|
tooltip: rotationSpinBox.enabled ? qsTr("Angle (in degree)") : root.disabledTooltip
|
||||||
enabled: backendValues.rotation.isAvailable
|
enabled: backendValues.rotation?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
TODO QDS-4835
|
TODO QDS-4835
|
||||||
@@ -217,7 +217,7 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Scale")
|
text: qsTr("Scale")
|
||||||
tooltip: qsTr("Sets the scale of the component by percentage.")
|
tooltip: qsTr("Sets the scale of the component by percentage.")
|
||||||
blockedByTemplate: !backendValues.scale.isAvailable
|
blockedByTemplate: !backendValues.scale?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
@@ -231,7 +231,7 @@ Section {
|
|||||||
stepSize: 0.1
|
stepSize: 0.1
|
||||||
minimumValue: -10
|
minimumValue: -10
|
||||||
maximumValue: 10
|
maximumValue: 10
|
||||||
enabled: backendValues.scale.isAvailable
|
enabled: backendValues.scale?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
Spacer { implicitWidth: StudioTheme.Values.controlLabelGap }
|
||||||
@@ -239,7 +239,7 @@ Section {
|
|||||||
ControlLabel {
|
ControlLabel {
|
||||||
text: "%"
|
text: "%"
|
||||||
tooltip: scaleSpinBox.enabled ? qsTr("Percentage") : root.disabledTooltip
|
tooltip: scaleSpinBox.enabled ? qsTr("Percentage") : root.disabledTooltip
|
||||||
enabled: backendValues.scale.isAvailable
|
enabled: backendValues.scale?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
@@ -265,13 +265,13 @@ Section {
|
|||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
text: qsTr("Origin")
|
text: qsTr("Origin")
|
||||||
tooltip: qsTr("Sets the modification point of the component.")
|
tooltip: qsTr("Sets the modification point of the component.")
|
||||||
blockedByTemplate: !backendValues.transformOrigin.isAvailable
|
blockedByTemplate: !backendValues.transformOrigin?.isAvailable
|
||||||
}
|
}
|
||||||
|
|
||||||
SecondColumnLayout {
|
SecondColumnLayout {
|
||||||
OriginControl {
|
OriginControl {
|
||||||
backendValue: backendValues.transformOrigin
|
backendValue: backendValues.transformOrigin
|
||||||
enabled: backendValues.transformOrigin.isAvailable
|
enabled: backendValues.transformOrigin?.isAvailable ?? false
|
||||||
}
|
}
|
||||||
|
|
||||||
ExpandingSpacer {}
|
ExpandingSpacer {}
|
||||||
|
@@ -89,7 +89,7 @@ PropertyEditorPane {
|
|||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
|
|
||||||
StudioControls.TabButton {
|
StudioControls.TabButton {
|
||||||
text: backendValues.__classNamePrivateInternal.value
|
text: backendValues.__classNamePrivateInternal?.value
|
||||||
onClicked: () => {
|
onClicked: () => {
|
||||||
if (itemPane.searchBar.hasDoneSearch)
|
if (itemPane.searchBar.hasDoneSearch)
|
||||||
itemPane.searchBar.search();
|
itemPane.searchBar.search();
|
||||||
|
@@ -10,7 +10,7 @@ Section {
|
|||||||
anchors.left: parent.left
|
anchors.left: parent.left
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
caption: qsTr("Layer")
|
caption: qsTr("Layer")
|
||||||
visible: backendValues.layer_effect.isAvailable
|
visible: backendValues.layer_effect?.isAvailable ?? false
|
||||||
|
|
||||||
SectionLayout {
|
SectionLayout {
|
||||||
PropertyLabel {
|
PropertyLabel {
|
||||||
@@ -22,7 +22,7 @@ Section {
|
|||||||
CheckBox {
|
CheckBox {
|
||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
text: backendValues.layer_enabled.valueToString
|
text: backendValues.layer_enabled?.valueToString
|
||||||
backendValue: backendValues.layer_enabled
|
backendValue: backendValues.layer_enabled
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -81,7 +81,7 @@ Section {
|
|||||||
|
|
||||||
function syncIndexToBackendValue() {
|
function syncIndexToBackendValue() {
|
||||||
samplesComboBox.block = true
|
samplesComboBox.block = true
|
||||||
samplesComboBox.currentIndex = samplesComboBox.model.indexOf(backendValues.layer_samples.value)
|
samplesComboBox.currentIndex = samplesComboBox.model.indexOf(backendValues.layer_samples?.value)
|
||||||
samplesComboBox.block = false
|
samplesComboBox.block = false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -214,7 +214,7 @@ Section {
|
|||||||
CheckBox {
|
CheckBox {
|
||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
text: backendValues.layer_mipmap.valueToString
|
text: backendValues.layer_mipmap?.valueToString
|
||||||
backendValue: backendValues.layer_mipmap
|
backendValue: backendValues.layer_mipmap
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -230,7 +230,7 @@ Section {
|
|||||||
CheckBox {
|
CheckBox {
|
||||||
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
implicitWidth: StudioTheme.Values.twoControlColumnWidth
|
||||||
+ StudioTheme.Values.actionIndicatorWidth
|
+ StudioTheme.Values.actionIndicatorWidth
|
||||||
text: backendValues.layer_smooth.valueToString
|
text: backendValues.layer_smooth?.valueToString
|
||||||
backendValue: backendValues.layer_smooth
|
backendValue: backendValues.layer_smooth
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -112,6 +112,11 @@ StudioControls.ComboBox {
|
|||||||
comboBox.currentIndex = comboBox.indexOfValue(comboBox.backendValue.value)
|
comboBox.currentIndex = comboBox.indexOfValue(comboBox.backendValue.value)
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
if (!comboBox.backendValue) {
|
||||||
|
comboBox.block = false
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
switch (comboBox.valueType) {
|
switch (comboBox.valueType) {
|
||||||
case ComboBox.ValueType.String:
|
case ComboBox.ValueType.String:
|
||||||
if (comboBox.currentText !== comboBox.backendValue.value) {
|
if (comboBox.currentText !== comboBox.backendValue.value) {
|
||||||
@@ -129,9 +134,6 @@ StudioControls.ComboBox {
|
|||||||
break
|
break
|
||||||
case ComboBox.ValueType.Enum:
|
case ComboBox.ValueType.Enum:
|
||||||
default:
|
default:
|
||||||
if (!comboBox.backendValue)
|
|
||||||
break
|
|
||||||
|
|
||||||
var enumString = comboBox.backendValue.enumeration
|
var enumString = comboBox.backendValue.enumeration
|
||||||
|
|
||||||
if (enumString === "")
|
if (enumString === "")
|
||||||
|
@@ -36,7 +36,7 @@ Section {
|
|||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
anchors.leftMargin: StudioTheme.Values.inputHorizontalPadding
|
anchors.leftMargin: StudioTheme.Values.inputHorizontalPadding
|
||||||
anchors.topMargin: StudioTheme.Values.typeLabelVerticalShift
|
anchors.topMargin: StudioTheme.Values.typeLabelVerticalShift
|
||||||
text: backendValues.__classNamePrivateInternal.value
|
text: backendValues.__classNamePrivateInternal?.value ?? ""
|
||||||
}
|
}
|
||||||
|
|
||||||
ToolTipArea {
|
ToolTipArea {
|
||||||
|
@@ -31,6 +31,9 @@ Row {
|
|||||||
id: colorLogic
|
id: colorLogic
|
||||||
backendValue: root.backendValue
|
backendValue: root.backendValue
|
||||||
onValueFromBackendChanged: {
|
onValueFromBackendChanged: {
|
||||||
|
if (!root.backendValue)
|
||||||
|
return
|
||||||
|
|
||||||
var enumString = root.backendValue.enumeration
|
var enumString = root.backendValue.enumeration
|
||||||
if (enumString === "")
|
if (enumString === "")
|
||||||
enumString = root.backendValue.value
|
enumString = root.backendValue.value
|
||||||
|
Reference in New Issue
Block a user