mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
[ui] add more explicit doc for QML helpers singleton
This commit is contained in:
parent
6d07323580
commit
9ce077778b
2 changed files with 13 additions and 7 deletions
|
@ -84,14 +84,20 @@ class MeshroomApp(QApplication):
|
|||
|
||||
# expose available node types that can be instantiated
|
||||
self.engine.rootContext().setContextProperty("_nodeTypes", sorted(nodesDesc.keys()))
|
||||
|
||||
# instantiate Reconstruction object
|
||||
r = Reconstruction(parent=self)
|
||||
self.engine.rootContext().setContextProperty("_reconstruction", r)
|
||||
pm = PaletteManager(self.engine, parent=self)
|
||||
self.engine.rootContext().setContextProperty("_PaletteManager", pm)
|
||||
fpHelper = FilepathHelper(parent=self)
|
||||
self.engine.rootContext().setContextProperty("Filepath", fpHelper)
|
||||
scene3DHelper = Scene3DHelper(parent=self)
|
||||
self.engine.rootContext().setContextProperty("Scene3DHelper", scene3DHelper)
|
||||
|
||||
# those helpers should be available from QML Utils module as singletons, but:
|
||||
# - qmlRegisterUncreatableType is not yet available in PySide2
|
||||
# - declaring them as singleton in qmldir file causes random crash at exit
|
||||
# => expose them as context properties instead
|
||||
self.engine.rootContext().setContextProperty("Filepath", FilepathHelper(parent=self))
|
||||
self.engine.rootContext().setContextProperty("Scene3DHelper", Scene3DHelper(parent=self))
|
||||
|
||||
# additional context properties
|
||||
self.engine.rootContext().setContextProperty("_PaletteManager", PaletteManager(self.engine, parent=self))
|
||||
self.engine.rootContext().setContextProperty("MeshroomApp", self)
|
||||
# Request any potential computation to stop on exit
|
||||
self.aboutToQuit.connect(r.stopExecution)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue