31 from python_qt_binding.QtCore
import qDebug, QObject, Qt
39 """Manager of `DockWidgetContainer`s enabling reparenting to stored parent.""" 41 def __init__(self, root_main_window, parent=None):
42 super(ContainerManager, self).
__init__(parent)
45 self._container_descriptor.set_action_attributes(
46 self.tr(
'Container'), self.tr(
'Container for other dock widgets'),
47 'folder-new',
'theme')
61 self.
_containers[container.serial_number()] = container
72 return self._containers.values()
75 floating = container.isFloating()
76 for child
in container.main_window.children():
77 if isinstance(child, DockWidget):
78 area = container.main_window.dockWidgetArea(child)
79 container.parent().addDockWidget(area, child)
81 child.setFloating(floating)
84 for container
in self._containers.values():
85 for child
in container.main_window.children():
86 if child == dock_widget:
91 for container
in self._containers.values():
92 container.restore_state()
95 if e.type() == ReparentEvent.reparent_event_type:
96 qDebug(
'ContainerManager.event() reparent event: new parent=%s' %
97 e.new_parent.objectName())
98 floating = e.dock_widget.isFloating()
99 pos = e.dock_widget.pos()
100 e.new_parent.addDockWidget(Qt.BottomDockWidgetArea, e.dock_widget)
102 e.dock_widget.setFloating(floating)
103 e.dock_widget.move(pos)
106 return super(ContainerManager, self).
event(e)
def get_root_main_window(self)
def get_container_of_dock_widget(self, dock_widget)
def add_container(self, container)
def restore_state_of_containers(self)
def remove_container(self, container)
def get_container(self, serial_number)
def __init__(self, root_main_window, parent=None)
def get_container_descriptor(self)
def add_to_plugin_menu(self, plugin_menu)
def move_container_children_to_parent(self, container)