Merge branch 'lidstrom83-DockArea_apoptose_fix' into develop

Also corrected temporary container persisting after calling dockarea.addDock()
This commit is contained in:
Luke Campagnola 2015-03-14 15:49:45 -04:00
commit b700a1ad3d
4 changed files with 12 additions and 6 deletions

View File

@ -3,9 +3,11 @@ pyqtgraph-0.9.11 [unreleased]
Bugfixes:
- Fixed git version string generation on python3
- Fixed setting default values for out-of-bound points in pg.interpolateArray
- Fixed adding Docks to DockArea after all Docks have been removed
- Fixed plot downsampling bug on python 3
New Features:
- PyQt5 support
- Preliminary PyQt5 support
pyqtgraph-0.9.10

View File

@ -34,6 +34,7 @@ Contributors
* John David Reaver
* David Kaplan
* Martin Fitzpatrick
* Daniel Lidstrom
Requirements
------------

View File

@ -11,6 +11,7 @@ class Dock(QtGui.QWidget, DockDrop):
def __init__(self, name, area=None, size=(10, 10), widget=None, hideTitle=False, autoOrientation=True, closable=False):
QtGui.QWidget.__init__(self)
DockDrop.__init__(self)
self._container = None
self.area = area
self.label = DockLabel(name, self, closable)
if closable:

View File

@ -102,9 +102,12 @@ class DockArea(Container, QtGui.QWidget, DockDrop):
'below': 'after'
}[position]
#print "request insert", dock, insertPos, neighbor
old = dock.container()
container.insert(dock, insertPos, neighbor)
dock.area = self
self.docks[dock.name()] = dock
if old is not None:
old.apoptose()
return dock
@ -112,12 +115,10 @@ class DockArea(Container, QtGui.QWidget, DockDrop):
"""
Move an existing Dock to a new location.
"""
old = dock.container()
## Moving to the edge of a tabbed dock causes a drop outside the tab box
if position in ['left', 'right', 'top', 'bottom'] and neighbor is not None and neighbor.container() is not None and neighbor.container().type() == 'tab':
neighbor = neighbor.container()
self.addDock(dock, position, neighbor)
old.apoptose()
def getContainer(self, obj):
if obj is None:
@ -296,8 +297,9 @@ class DockArea(Container, QtGui.QWidget, DockDrop):
def apoptose(self):
#print "apoptose area:", self.temporary, self.topContainer, self.topContainer.count()
if self.temporary and self.topContainer.count() == 0:
if self.topContainer.count() == 0:
self.topContainer = None
if self.temporary:
self.home.removeTempArea(self)
#self.close()