def set_layout(self, layout):
        # Remove all existing dock widgets.
        for child in self.control.children():
            if isinstance(child, QtGui.QDockWidget):
                child.hide()
                self.control.removeDockWidget(child)

        # Perform the layout. This will assign fixed sizes to the dock widgets
        # to enforce size constraints specified in the PaneItems.
        for name, q_dock_area in AREA_MAP.iteritems():
            sublayout = getattr(layout, name)
            if sublayout:
                self.set_layout_for_area(sublayout, q_dock_area,
                                         _toplevel_call=False)

        # Remove the fixed sizes once Qt activates the layout.
        QtCore.QTimer.singleShot(0, self._reset_fixed_sizes)
Applies a DockLayout to the window.
dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/tasks/main_window_layout.py/MainWindowLayout.set_layout