Qt5->Qt6: (Until) attempted fix Python 3.10 'stack overflow' issue.

part of CURA-8591
This commit is contained in:
Remco Burema 2021-12-28 18:12:36 +01:00
parent 7021ff0b67
commit b62e708b87
No known key found for this signature in database
GPG key ID: 215C49431D43F98C
3 changed files with 13 additions and 10 deletions

View file

@ -217,7 +217,7 @@ class CuraApplication(QtApplication):
self._quality_profile_drop_down_menu_model = None
self._custom_quality_profile_drop_down_menu_model = None
self._cura_API = CuraAPI(self)
self._cura_API = None
self._physics = None
self._volume = None
@ -682,8 +682,8 @@ class CuraApplication(QtApplication):
def messageBox(self, title, text,
informativeText = "",
detailedText = "",
buttons = QMessageBox.Ok,
icon = QMessageBox.NoIcon,
buttons = QMessageBox.StandardButton.Ok,
icon = QMessageBox.Icon.NoIcon,
callback = None,
callback_arguments = []
):
@ -837,7 +837,7 @@ class CuraApplication(QtApplication):
self._setting_visibility_presets_model = SettingVisibilityPresetsModel(self.getPreferences(), parent = self)
# Initialize Cura API
self._cura_API.initialize()
self._cura_API = self.getCuraAPI()
self.processEvents()
self._output_device_manager.start()
self._welcome_pages_model.initialize()
@ -1087,7 +1087,7 @@ class CuraApplication(QtApplication):
def event(self, event):
"""Handle Qt events"""
if event.type() == QEvent.FileOpen:
if event.type() == QEvent.Type.FileOpen:
if self._plugins_loaded:
self._openFile(event.file())
else:
@ -1114,6 +1114,9 @@ class CuraApplication(QtApplication):
return self._custom_quality_profile_drop_down_menu_model
def getCuraAPI(self, *args, **kwargs) -> "CuraAPI":
if not self._cura_API:
self._cura_API = CuraAPI(self)
self._cura_API.initialize()
return self._cura_API
def registerObjects(self, engine):