From 63deea4721204d010a68e4800a5d287e5da4a492 Mon Sep 17 00:00:00 2001 From: Ghostkeeper Date: Fri, 22 Jan 2021 13:52:27 +0100 Subject: [PATCH] Fix model to use for comboboxes to check if they are empty This was checking against the wrong model, it seems. Contributes to issue CURA-7865. --- resources/qml/Widgets/ComboBox.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/resources/qml/Widgets/ComboBox.qml b/resources/qml/Widgets/ComboBox.qml index 26324d7773..7eb366f0a3 100644 --- a/resources/qml/Widgets/ComboBox.qml +++ b/resources/qml/Widgets/ComboBox.qml @@ -23,7 +23,7 @@ ComboBox property var defaultTextOnEmptyModel: catalog.i18nc("@label", "No items to select from") // Text displayed in the combobox when the model is empty property var defaultTextOnEmptyIndex: "" // Text displayed in the combobox when the model has items but no item is selected - enabled: model.count > 0 + enabled: delegateModel.count > 0 onVisibleChanged: { popup.close() } @@ -81,7 +81,7 @@ ComboBox text: { - if (control.model.count == 0) + if (control.delegateModel.count == 0) { return control.defaultTextOnEmptyModel != "" ? control.defaultTextOnEmptyModel : control.defaultTextOnEmptyIndex }