[ui] app: Register components to QML before instantiating the engine

This commit is contained in:
Candice Bentéjac 2025-02-18 18:15:19 +01:00
parent 6355037036
commit 96a9757f5c

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())})