minor fixes

This commit is contained in:
Luke Campagnola 2017-09-15 09:00:50 -07:00
parent d65026f73d
commit fedecc5808
2 changed files with 11 additions and 4 deletions

View File

@ -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)

View File

@ -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()