From ba805b9da3f4d26f7bb9dda45b6ab148dacba786 Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Thu, 3 Oct 2019 12:26:56 +0200 Subject: [PATCH] Fix QML errors CURA-6849 --- resources/qml/Preferences/ProfileTab.qml | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/resources/qml/Preferences/ProfileTab.qml b/resources/qml/Preferences/ProfileTab.qml index 12846cf99b..3c0c46ed72 100644 --- a/resources/qml/Preferences/ProfileTab.qml +++ b/resources/qml/Preferences/ProfileTab.qml @@ -38,14 +38,28 @@ Tab property var setting: qualitySettings.getItem(styleData.row) height: childrenRect.height width: (parent != null) ? parent.width : 0 - text: (styleData.value.substr(0,1) == "=") ? styleData.value : "" + text: + { + if (styleData.value === undefined) + { + return "" + } + return (styleData.value.substr(0,1) == "=") ? styleData.value : "" + } Label { anchors.left: parent.left anchors.leftMargin: UM.Theme.getSize("default_margin").width anchors.right: parent.right - text: (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value + text: + { + if (styleData.value === undefined) + { + return "" + } + return (styleData.value.substr(0,1) == "=") ? catalog.i18nc("@info:status", "Calculated") : styleData.value + } font.strikeout: styleData.column == 1 && setting.user_value != "" && base.isQualityItemCurrentlyActivated font.italic: setting.profile_value_source == "quality_changes" || (setting.user_value != "" && base.isQualityItemCurrentlyActivated) opacity: font.strikeout ? 0.5 : 1