Fix selection of FlowchartWidget input/output nodes from issue #808 (#809)

Co-authored-by: Chris Stuart <chris.stuart@ukaea.uk>
This commit is contained in:
christuart 2020-05-30 07:35:58 +01:00 committed by GitHub
parent be6f28b03c
commit ddb597a3dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 1 deletions

View File

@ -763,6 +763,9 @@ class FlowchartCtrlWidget(QtGui.QWidget):
item = self.items[node]
self.ui.ctrlList.setCurrentItem(item)
def clearSelection(self):
self.ui.ctrlList.selectionModel().clearSelection()
class FlowchartWidget(dockarea.DockArea):
"""Includes the actual graphical flowchart and debugging interface"""
@ -890,7 +893,10 @@ class FlowchartWidget(dockarea.DockArea):
item = items[0]
if hasattr(item, 'node') and isinstance(item.node, Node):
n = item.node
self.ctrl.select(n)
if n in self.ctrl.items:
self.ctrl.select(n)
else:
self.ctrl.clearSelection()
data = {'outputs': n.outputValues(), 'inputs': n.inputValues()}
self.selNameLabel.setText(n.name())
if hasattr(n, 'nodeName'):