Merge pull request #2283 from alicevision/fix/loadingStatus

[Viewer] Viewer: Fix various issues with the 2D Viewer
This commit is contained in:
Candice Bentéjac 2024-01-03 11:36:30 +01:00 committed by GitHub
commit a7f73175e9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 21 additions and 18 deletions

View file

@ -290,7 +290,7 @@ AliceVision.PanoramaViewer {
'canBeHovered': true, 'canBeHovered': true,
'useSequence': false 'useSequence': false
}) })
imageLoaded = Qt.binding(function() { return repeater.itemAt(index).item.status === Image.Ready ? true : false }) imageLoaded = Qt.binding(function() { return repeater.itemAt(index).item.imageStatus === Image.Ready ? true : false })
} }
} }

View file

@ -87,7 +87,7 @@ FloatingPane {
interval: 1000 / m.fps interval: 1000 / m.fps
onTriggered: { onTriggered: {
if (viewer.status !== Image.Ready) { if (viewer.imageStatus !== Image.Ready) {
// Wait for current image to be displayed before switching to next image // Wait for current image to be displayed before switching to next image
return; return;
} }

View file

@ -74,7 +74,7 @@ FocusScope {
if (!imgContainer.image) if (!imgContainer.image)
return "" return ""
var res = "" var res = ""
if (imgContainer.image.status === Image.Loading) { if (imgContainer.image.imageStatus === Image.Loading) {
res += " Image" res += " Image"
} }
if (mfeaturesLoader.status === Loader.Ready) { if (mfeaturesLoader.status === Loader.Ready) {
@ -372,7 +372,7 @@ FocusScope {
colorRGBA: { colorRGBA: {
if (!floatImageViewerLoader.item || if (!floatImageViewerLoader.item ||
floatImageViewerLoader.item.status !== Image.Ready) { floatImageViewerLoader.item.imageStatus !== Image.Ready) {
return null return null
} }
if (floatImageViewerLoader.item.containsMouse === false) { if (floatImageViewerLoader.item.containsMouse === false) {
@ -681,7 +681,7 @@ FocusScope {
width: imgContainer.width width: imgContainer.width
height: imgContainer.height height: imgContainer.height
visible: activeNode.isComputed && json !== undefined && imgContainer.image.status === Image.Ready visible: activeNode.isComputed && json !== undefined && imgContainer.image.imageStatus === Image.Ready
source: Filepath.stringToUrl(activeNode.attribute("outputData").value) source: Filepath.stringToUrl(activeNode.attribute("outputData").value)
viewpoint: _reconstruction.selectedViewpoint viewpoint: _reconstruction.selectedViewpoint
zoom: imgContainer.scale zoom: imgContainer.scale
@ -750,7 +750,7 @@ FocusScope {
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: false Layout.fillHeight: false
Layout.preferredHeight: childrenRect.height Layout.preferredHeight: childrenRect.height
visible: floatImageViewerLoader.item.imageStatus === Image.Error visible: floatImageViewerLoader.item !== null && floatImageViewerLoader.item.imageStatus === Image.Error
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
RowLayout { RowLayout {
@ -759,6 +759,7 @@ FocusScope {
Label { Label {
font.pointSize: 8 font.pointSize: 8
text: { text: {
if (floatImageViewerLoader.item !== null) {
switch (floatImageViewerLoader.item.status) { switch (floatImageViewerLoader.item.status) {
case 2: // AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING case 2: // AliceVision.FloatImageViewer.EStatus.OUTDATED_LOADING
return "Outdated Loading" return "Outdated Loading"
@ -770,6 +771,8 @@ FocusScope {
return "" return ""
} }
} }
return ""
}
horizontalAlignment: Text.AlignHCenter horizontalAlignment: Text.AlignHCenter
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
@ -1041,7 +1044,7 @@ FocusScope {
// zoom label // zoom label
MLabel { MLabel {
text: ((imgContainer.image && (imgContainer.image.status === Image.Ready)) ? imgContainer.scale.toFixed(2) : "1.00") + "x" text: ((imgContainer.image && (imgContainer.image.imageStatus === Image.Ready)) ? imgContainer.scale.toFixed(2) : "1.00") + "x"
MouseArea { MouseArea {
anchors.fill: parent anchors.fill: parent
acceptedButtons: Qt.LeftButton | Qt.RightButton acceptedButtons: Qt.LeftButton | Qt.RightButton
@ -1140,7 +1143,7 @@ FocusScope {
} }
ToolTip.text: activeNode ? "Panorama Viewer " + activeNode.label : "Panorama Viewer" ToolTip.text: activeNode ? "Panorama Viewer " + activeNode.label : "Panorama Viewer"
text: MaterialIcons.panorama_sphere text: MaterialIcons.panorama_photosphere
font.pointSize: 16 font.pointSize: 16
padding: 0 padding: 0
Layout.minimumWidth: 0 Layout.minimumWidth: 0
@ -1386,7 +1389,7 @@ FocusScope {
Component.onCompleted: { Component.onCompleted: {
running = Qt.binding(function() { running = Qt.binding(function() {
return (root.usePanoramaViewer === true && imgContainer.image && imgContainer.image.allImagesLoaded === false) return (root.usePanoramaViewer === true && imgContainer.image && imgContainer.image.allImagesLoaded === false)
|| (imgContainer.image && imgContainer.image.status === Image.Loading) || (imgContainer.image && imgContainer.image.imageStatus === Image.Loading)
}) })
} }
// disable the visibility when unused to avoid stealing the mouseEvent to the image color picker // disable the visibility when unused to avoid stealing the mouseEvent to the image color picker