[graph] ListAttribute: replace '__getitem__ by 'at'

__getitem__ is spuriously called when the object is used inside a Qt model and exposed to QML, leading to unexpected behaviors
This commit is contained in:
Yann Lanthony 2018-04-04 17:29:04 +02:00 committed by Yann Lanthony
parent a5cda66670
commit 2cd724f957
4 changed files with 25 additions and 22 deletions

View file

@ -122,7 +122,7 @@ class LiveSfmManager(QObject):
def imagePathsInCameraInit(self, node):
""" Get images in the given CameraInit node. """
assert node.nodeType == 'CameraInit'
return [vp.path.value for vp in node.viewpoints]
return [vp.path.value for vp in node.viewpoints.value]
def imagesInStep(self):
""" Get images in the current augmentation step. """
@ -304,11 +304,11 @@ class Reconstruction(UIGraph):
def allImagePaths(self):
""" Get all image paths in the reconstruction. """
return [vp.path.value for node in self._cameraInits for vp in node.viewpoints]
return [vp.path.value for node in self._cameraInits for vp in node.viewpoints.value]
def allViewIds(self):
""" Get all view Ids involved in the reconstruction. """
return [vp.viewId.value for node in self._cameraInits for vp in node.viewpoints]
return [vp.viewId.value for node in self._cameraInits for vp in node.viewpoints.value]
@Slot(QObject, graph.Node)
def handleFilesDrop(self, drop, cameraInit):