QmlDesigner: Fix missing reference to backendValue

While this fixes an error with a backendValue not being referenced
correctly, it also adds more strict referencing to the getBackendValue
function calls.

Change-Id: Ib1609c71e30fda6c6418d4542cf443b05d0bd6e8
Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Henning Gruendl
2022-05-20 17:00:49 +02:00
committed by Henning Gründl
parent 7b95988765
commit ac1e86fe74

View File

@@ -47,14 +47,14 @@ Section {
return backendValues[root.fontName + "_" + name] return backendValues[root.fontName + "_" + name]
} }
property variant fontFamily: getBackendValue("family") property variant fontFamily: root.getBackendValue("family")
property variant pointSize: getBackendValue("pointSize") property variant pointSize: root.getBackendValue("pointSize")
property variant pixelSize: getBackendValue("pixelSize") property variant pixelSize: root.getBackendValue("pixelSize")
property variant boldStyle: getBackendValue("bold") property variant boldStyle: root.getBackendValue("bold")
property variant italicStyle: getBackendValue("italic") property variant italicStyle: root.getBackendValue("italic")
property variant underlineStyle: getBackendValue("underline") property variant underlineStyle: root.getBackendValue("underline")
property variant strikeoutStyle: getBackendValue("strikeout") property variant strikeoutStyle: root.getBackendValue("strikeout")
onPointSizeChanged: sizeWidget.setPointPixelSize() onPointSizeChanged: sizeWidget.setPointPixelSize()
onPixelSizeChanged: sizeWidget.setPointPixelSize() onPixelSizeChanged: sizeWidget.setPointPixelSize()
@@ -144,20 +144,20 @@ Section {
text: qsTr("Style name") text: qsTr("Style name")
tooltip: qsTr("Font's style.") tooltip: qsTr("Font's style.")
enabled: styleNameComboBox.model.length enabled: styleNameComboBox.model.length
blockedByTemplate: !backendValue.isAvailable blockedByTemplate: !styleNameComboBox.backendValue.isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
ComboBox { ComboBox {
id: styleNameComboBox id: styleNameComboBox
property bool styleSet: backendValue.isInModel property bool styleSet: styleNameComboBox.backendValue.isInModel
implicitWidth: StudioTheme.Values.singleControlColumnWidth implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
width: implicitWidth width: implicitWidth
backendValue: getBackendValue("styleName") backendValue: root.getBackendValue("styleName")
model: styleNamesForFamily(fontComboBox.familyName) model: styleNamesForFamily(fontComboBox.familyName)
valueType: ComboBox.String valueType: ComboBox.String
enabled: backendValue.isAvailable && styleNameComboBox.model.length enabled: styleNameComboBox.backendValue.isAvailable && styleNameComboBox.model.length
} }
ExpandingSpacer {} ExpandingSpacer {}
@@ -260,7 +260,7 @@ Section {
implicitWidth: StudioTheme.Values.singleControlColumnWidth implicitWidth: StudioTheme.Values.singleControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
width: implicitWidth width: implicitWidth
backendValue: getBackendValue("weight") backendValue: root.getBackendValue("weight")
model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"] model: ["Normal", "Light", "ExtraLight", "Thin", "Medium", "DemiBold", "Bold", "ExtraBold", "Black"]
scope: "Font" scope: "Font"
enabled: !styleNameComboBox.styleSet enabled: !styleNameComboBox.styleSet
@@ -301,14 +301,14 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Letter spacing") text: qsTr("Letter spacing")
tooltip: qsTr("Letter spacing for the font.") tooltip: qsTr("Letter spacing for the font.")
blockedByTemplate: !getBackendValue("letterSpacing").isAvailable blockedByTemplate: !root.getBackendValue("letterSpacing").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
backendValue: getBackendValue("letterSpacing") backendValue: root.getBackendValue("letterSpacing")
decimals: 2 decimals: 2
minimumValue: -500 minimumValue: -500
maximumValue: 500 maximumValue: 500
@@ -322,14 +322,14 @@ Section {
PropertyLabel { PropertyLabel {
text: qsTr("Word spacing") text: qsTr("Word spacing")
tooltip: qsTr("Word spacing for the font.") tooltip: qsTr("Word spacing for the font.")
blockedByTemplate: !getBackendValue("wordSpacing").isAvailable blockedByTemplate: !root.getBackendValue("wordSpacing").isAvailable
} }
SecondColumnLayout { SecondColumnLayout {
SpinBox { SpinBox {
implicitWidth: StudioTheme.Values.twoControlColumnWidth implicitWidth: StudioTheme.Values.twoControlColumnWidth
+ StudioTheme.Values.actionIndicatorWidth + StudioTheme.Values.actionIndicatorWidth
backendValue: getBackendValue("wordSpacing") backendValue: root.getBackendValue("wordSpacing")
decimals: 2 decimals: 2
minimumValue: -500 minimumValue: -500
maximumValue: 500 maximumValue: 500