From 296f8af59cbef5121a016c6917e0a5da1b55c98f Mon Sep 17 00:00:00 2001 From: Lipu Fei Date: Tue, 1 Oct 2019 16:15:33 +0200 Subject: [PATCH] Always clear ListModel so layer height selector will align properly CURA-6836 --- cura/Machines/Models/QualityProfilesDropDownMenuModel.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py index 8b3999275d..ab40f440ec 100644 --- a/cura/Machines/Models/QualityProfilesDropDownMenuModel.py +++ b/cura/Machines/Models/QualityProfilesDropDownMenuModel.py @@ -63,6 +63,13 @@ class QualityProfilesDropDownMenuModel(ListModel): def _update(self): Logger.log("d", "Updating {model_class_name}.".format(model_class_name = self.__class__.__name__)) + # CURA-6836 + # LabelBar is a repeater that creates labels for quality layer heights. Because of an optimization in + # UM.ListModel, the model will not remove all items and recreate new ones every time there's an update. + # Because LabelBar uses Repeater with Labels anchoring to "undefined" in certain cases, the anchoring will be + # kept the same as before. + self.setItems([]) + global_stack = cura.CuraApplication.CuraApplication.getInstance().getGlobalContainerStack() if global_stack is None: self.setItems([])