From fedecc5808e41a8c7d10e8803e758cbe13f90572 Mon Sep 17 00:00:00 2001 From: Luke Campagnola Date: Fri, 15 Sep 2017 09:00:50 -0700 Subject: [PATCH] minor fixes --- pyqtgraph/flowchart/Flowchart.py | 3 ++- pyqtgraph/flowchart/library/common.py | 12 +++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py index b623f5c7..e31f3999 100644 --- a/pyqtgraph/flowchart/Flowchart.py +++ b/pyqtgraph/flowchart/Flowchart.py @@ -189,7 +189,8 @@ class Flowchart(Node): self.viewBox.addItem(item) item.moveBy(*pos) self._nodes[name] = node - self.widget().addNode(node) + if node is not self.inputNode and node is not self.outputNode: + self.widget().addNode(node) node.sigClosed.connect(self.nodeClosed) node.sigRenamed.connect(self.nodeRenamed) node.sigOutputChanged.connect(self.nodeOutputChanged) diff --git a/pyqtgraph/flowchart/library/common.py b/pyqtgraph/flowchart/library/common.py index 425fe86c..8b3376c3 100644 --- a/pyqtgraph/flowchart/library/common.py +++ b/pyqtgraph/flowchart/library/common.py @@ -30,6 +30,11 @@ def generateUi(opts): k, t, o = opt else: raise Exception("Widget specification must be (name, type) or (name, type, {opts})") + + ## clean out these options so they don't get sent to SpinBox + hidden = o.pop('hidden', False) + tip = o.pop('tip', None) + if t == 'intSpin': w = QtGui.QSpinBox() if 'max' in o: @@ -63,11 +68,12 @@ def generateUi(opts): w = ColorButton() else: raise Exception("Unknown widget type '%s'" % str(t)) - if 'tip' in o: - w.setToolTip(o['tip']) + + if tip is not None: + w.setToolTip(tip) w.setObjectName(k) l.addRow(k, w) - if o.get('hidden', False): + if hidden: w.hide() label = l.labelForField(w) label.hide()