Merge pull request #1839 from alicevision/dev/fixQmlWarnings

[ui] Fix all "TypeError" QML warnings
This commit is contained in:
Fabien Castan 2022-12-06 11:38:16 +01:00 committed by GitHub
commit a2f559f48a
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 103 additions and 90 deletions

View file

@ -14,7 +14,7 @@ MessageDialog {
// the UIGraph instance
property var uigraph
// alias to underlying compatibilityNodes model
readonly property var nodesModel: uigraph.graph.compatibilityNodes
readonly property var nodesModel: uigraph ? uigraph.graph.compatibilityNodes : undefined
// the total number of compatibility issues
readonly property int issueCount: (nodesModel != undefined) ? nodesModel.count : 0
// the number of CompatibilityNodes that can be upgraded
@ -47,7 +47,10 @@ MessageDialog {
title: "Compatibility issues detected"
text: "This project contains " + issueCount + " node(s) incompatible with the current version of Meshroom."
detailedText: "Project was created with Meshroom " + uigraph.graph.fileReleaseVersion + "."
detailedText: {
let releaseVersion = uigraph ? uigraph.graph.fileReleaseVersion : "0.0"
return "Project was created with Meshroom " + releaseVersion + "."
}
helperText: upgradableCount ?
upgradableCount + " node(s) can be upgraded but this might invalidate already computed data.\n"

View file

@ -441,7 +441,7 @@ Item {
MenuItem {
text: "Submit"
enabled: nodeMenu.canComputeNode && nodeMenu.canSubmitOrCompute > 1
visible: uigraph.canSubmit
visible: uigraph ? uigraph.canSubmit : false
height: visible ? implicitHeight : 0
onTriggered: submitRequest(nodeMenu.currentNode)
}
@ -759,7 +759,7 @@ Item {
flat: true
model: ['Minimum', 'Maximum']
implicitWidth: 80
currentIndex: uigraph.layout.depthMode
currentIndex: uigraph ? uigraph.layout.depthMode : -1
onActivated: {
uigraph.layout.depthMode = currentIndex
}

View file

@ -31,7 +31,7 @@ FocusScope {
selectByMouse: true
selectionColor: activePalette.highlight
color: activePalette.text
text: node.documentation
text: node ? node.documentation : ""
wrapMode: TextEdit.Wrap
}
}

View file

@ -39,7 +39,7 @@ Item {
TextMetrics {
id: nbMetrics
text: root.taskManager.nodes.count
text: root.taskManager ? root.taskManager.nodes.count : "0"
}
TextMetrics {
@ -67,7 +67,7 @@ Item {
anchors.fill: parent
ScrollBar.vertical: ScrollBar {}
model: parent.taskManager.nodes
model: parent.taskManager ? parent.taskManager.nodes : null
spacing: 3
headerPositioning: ListView.OverlayHeader