

def get_layout_for_area(self, q_dock_area, include_sizes=True):
    ' Gets a LayoutItem for the specified dock area.\n        '
    items = set()
    rects = {
        
    }
    for child in self.control.children():
        if (isinstance(child, QtGui.QDockWidget) and child.isVisible() and (self.control.dockWidgetArea(child) == q_dock_area) and (child.x() >= 0) and (child.y() >= 0)):
            geometry = child.geometry()
            tabs = [tab for tab in self.control.tabifiedDockWidgets(child) if tab.isVisible()]
            if tabs:
                tab_bar = self._get_tab_bar(child)
                tab_index = tab_index.currentIndex()
                tabs.insert(tab_index, child)
                geometry = tab_bar.geometry().united(geometry)
            if tabs:
                panes = [self._prepare_pane(dock_widget, include_sizes) for dock_widget in tabs]
                item = Tabbed(*panes, active_tab=panes[tab_index].id)
            else:
                item = self._prepare_pane(child, include_sizes)
            items.add(item)
            rects[item] = geometry
    while (len(items) > 1):
        (add, remove) = (set(), set())
        for (item1, item2) in combinations(items, 2):
            if ((item1 not in remove) and (item2 not in remove)):
                (rect1, rect2) = (rects[item1], rects[item2])
                orient = self._get_division_orientation(rect1, rect2, True)
                if (orient == QtCore.Qt.Horizontal):
                    if (rect1.y() < rect2.y()):
                        item = VSplitter(item1, item2)
                    else:
                        item = VSplitter(item2, item1)
                elif (orient == QtCore.Qt.Vertical):
                    if (rect1.x() < rect2.x()):
                        item = HSplitter(item1, item2)
                    else:
                        item = HSplitter(item2, item1)
                else:
                    continue
                rects[item] = rect1.united(rect2)
                add.add(item)
                remove.update((item1, item2))
        if (add or remove):
            items.update(add)
            items.difference_update(remove)
        else:
            raise RuntimeError('Unable to extract layout from QMainWindow.')
    if items:
        return items.pop()
    return None

dataset/ETHPy150Open enthought/pyface/pyface/ui/qt4/tasks/main_window_layout.py MainWindowLayout.get_layout_for_area/VarMisuse@144/199 `tab_bar`->`tab_index`