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.
This commit is contained in:
Ghostkeeper 2021-01-22 13:52:27 +01:00
parent 5a99ae168b
commit 63deea4721
No known key found for this signature in database
GPG key ID: D2A8871EE34EC59A

View file

@ -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
}