Merge pull request #2676 from alicevision/fix/qmlComponentsRegistration

[ui] app: Register components to QML before instantiating the engine
This commit is contained in:
Yann Lanthony 2025-02-19 12:20:03 +01:00 committed by GitHub
commit b29bcfe0c5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -250,6 +250,9 @@ class MeshroomApp(QApplication):
# be retrievable
self._updatedRecentProjectFilesThumbnails = True
# Register components for QML before instantiating the engine
components.registerTypes()
# QML engine setup
qmlDir = os.path.join(pwd, "qml")
url = os.path.join(qmlDir, "main.qml")
@ -263,7 +266,6 @@ class MeshroomApp(QApplication):
qInstallMessageHandler(MessageHandler.handler)
self.engine.addImportPath(qmlDir)
components.registerTypes()
# expose available node types that can be instantiated
self.engine.rootContext().setContextProperty("_nodeTypes", {n: {"category": nodesDesc[n].category} for n in sorted(nodesDesc.keys())})