diff --git a/cura/CuraApplication.py b/cura/CuraApplication.py index c2b67b8fbb..6eea5eaefe 100755 --- a/cura/CuraApplication.py +++ b/cura/CuraApplication.py @@ -10,7 +10,7 @@ from typing import cast, TYPE_CHECKING, Optional, Callable, List, Any, Dict import numpy from PyQt6.QtCore import QObject, QTimer, QUrl, pyqtSignal, pyqtProperty, QEvent, pyqtEnum from PyQt6.QtGui import QColor, QIcon -from PyQt6.QtQml import qmlRegisterUncreatableType, qmlRegisterSingletonType, qmlRegisterType +from PyQt6.QtQml import qmlRegisterUncreatableType, qmlRegisterUncreatableMetaObject, qmlRegisterSingletonType, qmlRegisterType from PyQt6.QtWidgets import QMessageBox import UM.Util @@ -1133,7 +1133,7 @@ class CuraApplication(QtApplication): engine.rootContext().setContextProperty("CuraSDKVersion", ApplicationMetadata.CuraSDKVersion) self.processEvents() - qmlRegisterUncreatableType(CuraApplication, "Cura", 1, 0, "ResourceTypes", "Just an Enum type") + qmlRegisterUncreatableMetaObject(CuraApplication.staticMetaObject, "Cura", 1, 0, "ResourceTypes", "ResourceTypes is an enum-only type") self.processEvents() qmlRegisterSingletonType(CuraSceneController, "Cura", 1, 0, self.getCuraSceneController, "SceneController") @@ -1193,7 +1193,7 @@ class CuraApplication(QtApplication): from cura.API import CuraAPI qmlRegisterSingletonType(CuraAPI, "Cura", 1, 1, self.getCuraAPI, "API") - qmlRegisterUncreatableType(Account, "Cura", 1, 0, "AccountSyncState", "Could not create AccountSyncState") + qmlRegisterUncreatableMetaObject(CuraApplication.staticMetaObject, "Cura", 1, 0, "AccountSyncState", "AccountSyncState is an enum-only type") # As of Qt5.7, it is necessary to get rid of any ".." in the path for the singleton to work. actions_url = QUrl.fromLocalFile(os.path.abspath(Resources.getPath(CuraApplication.ResourceTypes.QmlFiles, "Actions.qml"))) diff --git a/plugins/DigitalLibrary/src/DigitalFactoryController.py b/plugins/DigitalLibrary/src/DigitalFactoryController.py index 8d535b0a36..fa6c63e1dc 100644 --- a/plugins/DigitalLibrary/src/DigitalFactoryController.py +++ b/plugins/DigitalLibrary/src/DigitalFactoryController.py @@ -12,7 +12,7 @@ from typing import Optional, List, Dict, Any, cast from PyQt6.QtCore import pyqtSignal, QObject, pyqtSlot, pyqtProperty, pyqtEnum, QTimer, QUrl from PyQt6.QtNetwork import QNetworkReply -from PyQt6.QtQml import qmlRegisterType, qmlRegisterUncreatableType +from PyQt6.QtQml import qmlRegisterType, qmlRegisterUncreatableMetaObject from UM.FileHandler.FileHandler import FileHandler from UM.Logger import Logger @@ -439,7 +439,7 @@ class DigitalFactoryController(QObject): @staticmethod def _onEngineCreated() -> None: - qmlRegisterUncreatableType(DFRetrievalStatus, "DigitalFactory", 1, 0, "RetrievalStatus", "Could not create RetrievalStatus enum type") + qmlRegisterUncreatableMetaObject(DigitalFactoryController.staticMetaObject, "DigitalFactory", 1, 0, "RetrievalStatus", "RetrievalStatus is an Enum-only type") def _applicationInitializationFinished(self) -> None: self._supported_file_types = self._application.getInstance().getMeshFileHandler().getSupportedFileTypesRead()