diff --git a/pyqtgraph/dockarea/Dock.py b/pyqtgraph/dockarea/Dock.py index e07ae6a7..19ebc76e 100644 --- a/pyqtgraph/dockarea/Dock.py +++ b/pyqtgraph/dockarea/Dock.py @@ -186,7 +186,6 @@ class Dock(QtGui.QWidget, DockDrop): def startDrag(self): - print('startDrag') self.drag = QtGui.QDrag(self) mime = QtCore.QMimeData() #mime.setPlainText("asd") diff --git a/pyqtgraph/dockarea/DockArea.py b/pyqtgraph/dockarea/DockArea.py index 50769ce6..752cf3b6 100644 --- a/pyqtgraph/dockarea/DockArea.py +++ b/pyqtgraph/dockarea/DockArea.py @@ -33,12 +33,13 @@ class DockArea(Container, QtGui.QWidget, DockDrop): def type(self): return "top" - def addDock(self, dock, position='bottom', relativeTo=None): + def addDock(self, dock=None, position='bottom', relativeTo=None, **kwds): """Adds a dock to this area. =========== ================================================================= Arguments: - dock The new Dock object to add. + dock The new Dock object to add. If None, then a new Dock will be + created. position 'bottom', 'top', 'left', 'right', 'over', or 'under' relativeTo If relativeTo is None, then the new Dock is added to fill an entire edge of the window. If relativeTo is another Dock, then @@ -46,7 +47,12 @@ class DockArea(Container, QtGui.QWidget, DockDrop): configuration for 'over' and 'under'). =========== ================================================================= + All extra keyword arguments are passed to Dock.__init__() if *dock* is + None. """ + if dock is None: + dock = Dock(**kwds) + ## Determine the container to insert this dock into. ## If there is no neighbor, then the container is the top. @@ -100,6 +106,8 @@ class DockArea(Container, QtGui.QWidget, DockDrop): dock.area = self self.docks[dock.name()] = dock + return dock + def moveDock(self, dock, position, neighbor): """ Move an existing Dock to a new location. diff --git a/pyqtgraph/flowchart/Flowchart.py b/pyqtgraph/flowchart/Flowchart.py index 12d6a97c..a68cf542 100644 --- a/pyqtgraph/flowchart/Flowchart.py +++ b/pyqtgraph/flowchart/Flowchart.py @@ -206,17 +206,12 @@ class Flowchart(Node): item = node.graphicsItem() item.setZValue(self.nextZVal*2) self.nextZVal += 1 - #item.setParentItem(self.chartGraphicsItem()) self.viewBox.addItem(item) - #item.setPos(pos2.x(), pos2.y()) item.moveBy(*pos) self._nodes[name] = node self.widget().addNode(node) - #QtCore.QObject.connect(node, QtCore.SIGNAL('closed'), self.nodeClosed) node.sigClosed.connect(self.nodeClosed) - #QtCore.QObject.connect(node, QtCore.SIGNAL('renamed'), self.nodeRenamed) node.sigRenamed.connect(self.nodeRenamed) - #QtCore.QObject.connect(node, QtCore.SIGNAL('outputChanged'), self.nodeOutputChanged) node.sigOutputChanged.connect(self.nodeOutputChanged) def removeNode(self, node): @@ -225,17 +220,14 @@ class Flowchart(Node): def nodeClosed(self, node): del self._nodes[node.name()] self.widget().removeNode(node) - #QtCore.QObject.disconnect(node, QtCore.SIGNAL('closed'), self.nodeClosed) try: node.sigClosed.disconnect(self.nodeClosed) except TypeError: pass - #QtCore.QObject.disconnect(node, QtCore.SIGNAL('renamed'), self.nodeRenamed) try: node.sigRenamed.disconnect(self.nodeRenamed) except TypeError: pass - #QtCore.QObject.disconnect(node, QtCore.SIGNAL('outputChanged'), self.nodeOutputChanged) try: node.sigOutputChanged.disconnect(self.nodeOutputChanged) except TypeError: diff --git a/pyqtgraph/flowchart/library/Data.py b/pyqtgraph/flowchart/library/Data.py index 1c612e08..cbef848a 100644 --- a/pyqtgraph/flowchart/library/Data.py +++ b/pyqtgraph/flowchart/library/Data.py @@ -152,7 +152,7 @@ class RegionSelectNode(CtrlNode): #print " new rgn:", c, region #self.items[c].setYRange([0., 0.2], relative=True) - if self.selected.isConnected(): + if self['selected'].isConnected(): if data is None: sliced = None elif (hasattr(data, 'implements') and data.implements('MetaArray')): @@ -219,7 +219,6 @@ class EvalNode(Node): text = str(self.text.toPlainText()) if text != self.lastText: self.lastText = text - print("eval node update") self.update() return QtGui.QTextEdit.focusOutEvent(self.text, ev) diff --git a/pyqtgraph/flowchart/library/Display.py b/pyqtgraph/flowchart/library/Display.py index 7979d7a7..9068c0ec 100644 --- a/pyqtgraph/flowchart/library/Display.py +++ b/pyqtgraph/flowchart/library/Display.py @@ -21,7 +21,7 @@ class PlotWidgetNode(Node): self.items = {} def disconnected(self, localTerm, remoteTerm): - if localTerm is self.In and remoteTerm in self.items: + if localTerm is self['In'] and remoteTerm in self.items: self.plot.removeItem(self.items[remoteTerm]) del self.items[remoteTerm]