Merge branch 'lidstrom83-DockArea_apoptose_fix' into develop
Also corrected temporary container persisting after calling dockarea.addDock()
This commit is contained in:
commit
b700a1ad3d
@ -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
|
||||
|
||||
|
@ -34,6 +34,7 @@ Contributors
|
||||
* John David Reaver
|
||||
* David Kaplan
|
||||
* Martin Fitzpatrick
|
||||
* Daniel Lidstrom
|
||||
|
||||
Requirements
|
||||
------------
|
||||
|
@ -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:
|
||||
|
@ -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,10 +297,11 @@ 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
|
||||
self.home.removeTempArea(self)
|
||||
#self.close()
|
||||
if self.temporary:
|
||||
self.home.removeTempArea(self)
|
||||
#self.close()
|
||||
|
||||
## PySide bug: We need to explicitly redefine these methods
|
||||
## or else drag/drop events will not be delivered.
|
||||
|
Loading…
Reference in New Issue
Block a user