From 7bf3d0bd288faa28f5b1b9fa70b51fb36fd047cb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rub=C3=A9n=20P=C3=A9rez=20Alonso?= Date: Thu, 2 Jan 2025 13:59:56 +0100 Subject: [PATCH] Fix unit system change in the units FirstRunPrompt When changing unit system, the individual unit ComboBoxes weren't updating to reflect it. Fixed by forcing a model reload. --- src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml b/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml index b37a97c04d9..21d6ca37aed 100644 --- a/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml +++ b/src/FirstRunPromptDialogs/UnitsFirstRunPrompt.qml @@ -38,6 +38,10 @@ FirstRunPrompt { } function changeSystemOfUnits(metric) { + // Hack to force reload the ComboBoxes, otherwise they don't update + unitComboBoxRepeater.model = 0 + unitComboBoxRepeater.model = _rgFacts.length + if (_unitsSettings.horizontalDistanceUnits.visible) { _unitsSettings.horizontalDistanceUnits.value = metric ? UnitsSettings.HorizontalDistanceUnitsMeters : UnitsSettings.HorizontalDistanceUnitsFeet } @@ -100,6 +104,7 @@ FirstRunPrompt { } Repeater { + id: unitComboBoxRepeater model: _rgFacts.length FactComboBox { Layout.fillWidth: true