diff options
author | Ghostkeeper <rubend@tutanota.com> | 2021-10-08 18:46:10 +0300 |
---|---|---|
committer | Ghostkeeper <rubend@tutanota.com> | 2021-10-08 18:46:10 +0300 |
commit | 9729f4f3d2320a23181b544f4188089b35a382ef (patch) | |
tree | c2d38632c06e634221a6b9afe6932d9373d9d632 /cura/Machines/Models | |
parent | fb7e67b8ad575ca8227cee0fb56c3a19303a2f54 (diff) |
Set properties immediately upon constructing
Instead of afterwards. A bit more efficient.
Contributes to issue CURA-8609.
Diffstat (limited to 'cura/Machines/Models')
-rw-r--r-- | cura/Machines/Models/MaterialManagementModel.py | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/cura/Machines/Models/MaterialManagementModel.py b/cura/Machines/Models/MaterialManagementModel.py index 617fc5be9e..2994b48918 100644 --- a/cura/Machines/Models/MaterialManagementModel.py +++ b/cura/Machines/Models/MaterialManagementModel.py @@ -330,11 +330,12 @@ class MaterialManagementModel(QObject): """ if self._sync_all_dialog is None: qml_path = Resources.getPath(cura.CuraApplication.CuraApplication.ResourceTypes.QmlFiles, "Preferences", "Materials", "MaterialsSyncDialog.qml") - self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, {}) + self._sync_all_dialog = cura.CuraApplication.CuraApplication.getInstance().createQmlComponent(qml_path, { + "materialManagementModel": self, + "pageIndex": 0 + }) if self._sync_all_dialog is None: # Failed to load QML file. return - self._sync_all_dialog.setProperty("materialManagementModel", self) - self._sync_all_dialog.setProperty("pageIndex", 0) self._sync_all_dialog.show() @pyqtSlot(result = QUrl) |