mirror of
https://github.com/alicevision/Meshroom.git
synced 2025-08-03 16:58:24 +02:00
Merge pull request #2145 from alicevision/fix/cameraInitIdx
[ui] Preserve last `CameraInit` index when updating the CameraInits list
This commit is contained in:
commit
c02aa1f229
2 changed files with 14 additions and 1 deletions
|
@ -35,6 +35,14 @@ Panel {
|
|||
title: "Image Gallery"
|
||||
implicitWidth: (root.defaultCellSize + 2) * 2
|
||||
|
||||
Connections {
|
||||
target: _reconstruction
|
||||
|
||||
function onCameraInitChanged() {
|
||||
nodesCB.currentIndex = root.cameraInitIndex
|
||||
}
|
||||
}
|
||||
|
||||
QtObject {
|
||||
id: m
|
||||
property variant currentCameraInit: _reconstruction && _reconstruction.tempCameraInit ? _reconstruction.tempCameraInit : root.cameraInit
|
||||
|
|
|
@ -573,7 +573,12 @@ class Reconstruction(UIGraph):
|
|||
if set(self._cameraInits.objectList()) == set(cameraInits):
|
||||
return
|
||||
self._cameraInits.setObjectList(cameraInits)
|
||||
self.cameraInit = cameraInits[0] if cameraInits else None
|
||||
|
||||
if self.cameraInit is None or self.cameraInit not in cameraInits:
|
||||
self.cameraInit = cameraInits[0] if cameraInits else None
|
||||
|
||||
# Manually emit the signal to ensure the active CameraInit index is always up-to-date in the UI
|
||||
self.cameraInitChanged.emit()
|
||||
|
||||
def getCameraInitIndex(self):
|
||||
if not self._cameraInit:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue