[ui] update QML properties after changes in qtAV

This commit is contained in:
Loïc Vital 2023-03-08 08:45:19 +01:00
parent 33def1d6a5
commit 31b04092a0
4 changed files with 36 additions and 12 deletions

View file

@ -548,7 +548,10 @@ FocusScope {
// instantiate and initialize a FeaturesViewer component dynamically using Loader.setSource
setSource("FeaturesViewer.qml", {
'model': Qt.binding(function() { return activeNode ? activeNode.attribute("describerTypes").value : ""; }),
'currentViewId': Qt.binding(function() { return _reconstruction.selectedViewId; }),
'features': Qt.binding(function() { return mfeaturesLoader.status === Loader.Ready ? mfeaturesLoader.item : null; }),
'tracks': Qt.binding(function() { return mtracksLoader.status === Loader.Ready ? mtracksLoader.item : null; }),
'sfmData': Qt.binding(function() { return msfmDataLoader.status === Loader.Ready ? msfmDataLoader.item : null; }),
})
} else {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
@ -725,11 +728,9 @@ FocusScope {
// instantiate and initialize a MFeatures component dynamically using Loader.setSource
// so it can fail safely if the c++ plugin is not available
setSource("MFeatures.qml", {
'currentViewId': Qt.binding(function() { return _reconstruction.selectedViewId; }),
'describerTypes': Qt.binding(function() { return activeNode ? activeNode.attribute("describerTypes").value : {}; }),
'featureFolder': Qt.binding(function() { return activeNode ? Filepath.stringToUrl(activeNode.attribute("output").value) : ""; }),
'mtracks': Qt.binding(function() { return mtracksLoader.status === Loader.Ready ? mtracksLoader.item : null; }),
'msfmData': Qt.binding(function() { return msfmDataLoader.status === Loader.Ready ? msfmDataLoader.item : null; }),
'viewIds': Qt.binding(function() { return _reconstruction ? _reconstruction.allViewIds() : {}; }),
})
} else {