0
0
mirror of https://github.com/bec-project/bec_widgets.git synced 2025-07-14 03:31:50 +02:00

fix(dock): properly shut down docks and temp areas

This commit is contained in:
2024-08-07 13:15:30 +02:00
parent cf94599c25
commit 99ee545e41
2 changed files with 12 additions and 2 deletions

View File

@ -153,6 +153,7 @@ class BECDock(BECWidget, Dock):
super().dropEvent(event)
if old_area in self.orig_area.tempAreas and old_area != self.orig_area:
self.orig_area.removeTempArea(old_area)
old_area.window().deleteLater()
def float(self):
"""
@ -284,7 +285,7 @@ class BECDock(BECWidget, Dock):
"""
Attach the dock to the parent dock area.
"""
self.orig_area.removeTempArea(self.area)
self.parent_dock_area.remove_temp_area(self.area)
def detach(self):
"""

View File

@ -330,7 +330,16 @@ class BECDockArea(BECWidget, QWidget):
"""
while self.dock_area.tempAreas:
for temp_area in self.dock_area.tempAreas:
self.dock_area.removeTempArea(temp_area)
self.remove_temp_area(temp_area)
def remove_temp_area(self, area):
"""
Remove a temporary area from the dock area.
This is a patched method of pyqtgraph's removeTempArea
"""
self.dock_area.tempAreas.remove(area)
area.window().close()
area.window().deleteLater()
def clear_all(self):
"""