wip [PanoramaViewer] make repeater load different file paths

This commit is contained in:
Landrodie 2021-01-21 17:57:47 +01:00 committed by Fabien Castan
parent 6e048877f4
commit cf9dfa6552
2 changed files with 55 additions and 21 deletions

View file

@ -48,6 +48,8 @@ AliceVision.FloatImageViewer {
property int subdivisions: 5; property int subdivisions: 5;
property int pointsNumber: (subdivisions + 1) * (subdivisions + 1); property int pointsNumber: (subdivisions + 1) * (subdivisions + 1);
property int index: 0;
property string sfmPath: "" property string sfmPath: ""
function updateSfmPath() { function updateSfmPath() {

View file

@ -60,32 +60,64 @@ AliceVision.PanoramaViewer {
root.setSfmPath(sfmPath); root.setSfmPath(sfmPath);
} }
Component { property var paths: ["L:/IMAC/IMAC2/PTUT/22_190902_GDGM_F1_sph150/HDM_1306.JPG", "L:/IMAC/IMAC2/PTUT/22_190902_GDGM_F1_sph150/HDM_1313.JPG"]
id: imgPano
Loader {
id: floatOneLoader
active: root.status Item {
visible: (floatOneLoader.status === Loader.Ready) id: panoImages
anchors.centerIn: parent width: root.width
property string cSource: root.getImgSource() height: root.height
onActiveChanged: {
if(active) { function setSource() {
setSource("FloatImage.qml", { if (repeater.model === 0)
'source': Qt.binding(function() { return cSource; }), return
})
} else { // var width = repeater.itemAt(0).width;
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14 // var height = repeater.itemAt(0).height;
setSource("", {})
for (let i = 0; i < repeater.model; i++) {
console.warn(repeater.itemAt(i))
// repeater.itemAt(i).x = root.getVertex(i).x - (width / 2);
// repeater.itemAt(i).y = root.getVertex(i).y - (height / 2);
}
}
Component {
id: imgPano
Loader {
id: floatOneLoader
active: root.status
visible: (floatOneLoader.status === Loader.Ready)
//anchors.centerIn: parent
property string cSource: Filepath.stringToUrl(root.paths[index].toString())
onActiveChanged: {
if(active) {
setSource("FloatImage.qml", {
'source': Qt.binding(function() { return cSource; }),
'index' : index
})
console.warn(cSource)
console.warn(root.source)
} else {
// Force the unload (instead of using Component.onCompleted to load it once and for all) is necessary since Qt 5.14
setSource("", {})
}
}
onLoaded: {
//console.warn(repeater.itemAt(index))
repeater.itemAt(index).x = repeater.itemAt(0).width + 50* index
} }
} }
} }
Repeater {
id: repeater
model: 2
delegate: imgPano
}
} }
Repeater {
id: repeater
model: 1
delegate: imgPano
}
} }