def _split_widget_helper(area, orientation, widget, frame, append):
    splitter = widget.parent()
    if not isinstance(splitter, QDockSplitter):
        return False
    index = splitter.indexOf(widget)
    if splitter.orientation() == orientation:
        index += 1 if append else 0
        _splitter_insert_frame(area, splitter, index, frame)
        return True
    sizes = splitter.sizes()
    new = QDockSplitter(orientation)
    new.addWidget(widget)
    splitter.insertWidget(index, new)
    new.inheritOpaqueResize()
    index = new.count() if append else 0
    _splitter_insert_frame(area, new, index, frame)
    splitter.setSizes(sizes)
    return True
Split the widget according the orientation.
dataset/ETHPy150Open nucleic/enaml/enaml/qt/docking/layout_handling.py/_split_widget_helper