From f957cc289e591b7514e70dbc9816522a4179baef Mon Sep 17 00:00:00 2001 From: casper Date: Mon, 7 Feb 2022 22:01:45 +0100 Subject: [PATCH] Fix Qt warnings resolve binding loo in `SyncState` move `updateCostPerMeter` function to root of `MaterialView` such that it is available of all sub components Cura 8687 --- resources/qml/Account/SyncState.qml | 4 ++-- .../qml/Preferences/Materials/MaterialsView.qml | 12 ++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/resources/qml/Account/SyncState.qml b/resources/qml/Account/SyncState.qml index f09759f845..e370c653f7 100644 --- a/resources/qml/Account/SyncState.qml +++ b/resources/qml/Account/SyncState.qml @@ -82,8 +82,8 @@ Row // Sync state icon + message id: stateLabel // text is determined by State font: UM.Theme.getFont("medium") - width: contentWidth + UM.Theme.getSize("default_margin").height - height: contentHeight + anchors.leftMargin: UM.Theme.getSize("default_margin").width + anchors.rightMargin: UM.Theme.getSize("default_margin").width visible: !Cura.API.account.manualSyncEnabled && !Cura.API.account.updatePackagesEnabled } diff --git a/resources/qml/Preferences/Materials/MaterialsView.qml b/resources/qml/Preferences/Materials/MaterialsView.qml index 39997659e1..c43b31bbcb 100644 --- a/resources/qml/Preferences/Materials/MaterialsView.qml +++ b/resources/qml/Preferences/Materials/MaterialsView.qml @@ -420,12 +420,6 @@ Item Item { width: parent.width; height: UM.Theme.getSize("default_margin").height } } - - function updateCostPerMeter() - { - base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); - base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); - } } ListView @@ -518,6 +512,12 @@ Item } } + function updateCostPerMeter() + { + base.spoolLength = calculateSpoolLength(diameterSpinBox.value, densitySpinBox.value, spoolWeightSpinBox.value); + base.costPerMeter = calculateCostPerMeter(spoolCostSpinBox.value); + } + function calculateSpoolLength(diameter, density, spoolWeight) { if(!diameter)