Commit 9a659eb4 authored by Thomas Vincent's avatar Thomas Vincent

Fix select point in fit when QSpace was renamed

parent 1609865d
......@@ -251,7 +251,7 @@ class XsocsGui(Qt.QMainWindow):
if qspaceItem is None:
raise ValueError('This fitItem doesnt have a parent.')
index = self.centralWidget().pathToIndex(qspaceItem.path)
index = self.centralWidget().pathToIndex(qspaceItem.customPath)
node = index.data(ModelRoles.InternalDataRole)
qspaceView = self.__showQSpace(node, bringToFront=False)
qspaceView.selectPoint(point.x, point.y)
......
......@@ -287,6 +287,21 @@ class ProjectItem(XsocsH5Base):
else:
return ''
@property
def customPath(self):
"""Path with custom item names if defined"""
parent = self.parent()
if parent is not None:
path = parent.customPath
else:
path = ''
customName = self.getItemName()
if not customName:
customName = self.path.split('/')[-1]
return '/'.join((path, customName))
def _createItem(self):
"""
Called when the xsocsh5 file is succesfuly called. This should be used
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment