[Viewer] Prevent accessing null objects

This commit is contained in:
Candice Bentéjac 2023-01-26 18:44:58 +01:00
parent 4eac23a52d
commit 422d9da48c
2 changed files with 8 additions and 7 deletions

View file

@ -100,7 +100,7 @@ FloatingPane {
ToolTip.visible: hovered
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight
checked: root.featuresViewer.trackContiguousFilter
checked: root.featuresViewer ? root.featuresViewer.trackContiguousFilter : false
onClicked: root.featuresViewer.trackContiguousFilter = trackContiguousFilterCB.checked
}
}
@ -114,7 +114,7 @@ FloatingPane {
ToolTip.visible: hovered
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight
checked: root.featuresViewer.trackInliersFilter
checked: root.featuresViewer ? root.featuresViewer.trackInliersFilter : false
onClicked: root.featuresViewer.trackInliersFilter = trackInliersFilterCB.checked
}
}
@ -128,7 +128,7 @@ FloatingPane {
ToolTip.visible: hovered
Layout.fillHeight: true
Layout.alignment: Qt.AlignRight
checked: root.featuresViewer.display3dTracks
checked: root.featuresViewer ? root.featuresViewer.display3dTracks : false
onClicked: root.featuresViewer.display3dTracks = display3dTracksCB.checked
}
}
@ -158,7 +158,7 @@ FloatingPane {
Layout.alignment: Qt.AlignRight
from: -1
to: 50
value: root.featuresViewer.timeWindow
value: root.featuresViewer ? root.featuresViewer.timeWindow : 0
stepSize: 1
editable: true
@ -175,6 +175,7 @@ FloatingPane {
}
onValueChanged: {
if (root.featuresViewer)
root.featuresViewer.timeWindow = timeWindowSB.value;
}
}

View file

@ -460,7 +460,7 @@ FocusScope {
'isHighlightable': Qt.binding(function(){ return panoramaViewerToolbar.enableHover;}),
'displayGridPano': Qt.binding(function(){ return panoramaViewerToolbar.displayGrid;}),
'mouseMultiplier': Qt.binding(function(){ return panoramaViewerToolbar.mouseSpeed;}),
'msfmData': Qt.binding(function() { return (msfmDataLoader.status === Loader.Ready
'msfmData': Qt.binding(function() { return (msfmDataLoader && msfmDataLoader.item && msfmDataLoader.status === Loader.Ready
&& msfmDataLoader.item.status === 2) ? msfmDataLoader.item : null; }),
})
} else {