def _unplug_splitter(widget, container):
    sizes = widget.sizes()
    for index in xrange(widget.count()):
        success, replace = _unplug(widget.widget(index), container)
        if success:
            if replace is not None:
                widget.insertWidget(index, replace)
                replace.show()
                widget.setSizes(sizes)
            replace = None
            if widget.count() == 1:
                replace = widget.widget(0)
                replace.hide()
                replace.setParent(None)
                widget.hide()
                widget.setParent(None)
            return True, replace
    return False, None
The handler for a QDockSplitter widget.
dataset/ETHPy150Open nucleic/enaml/enaml/qt/docking/layout_handling.py/_unplug_splitter