def tabbox(box1, Box2): """ adds a box with tab """ tab_widget = QtGui.QTabWidget() for heading in [_("Graphe"), _("Table")]: pane = TabPane() if heading == "Graphe": pane.addBox(box1) else: pane.addBox(Box2) tab_widget.addTab(pane, heading) return tab_widget
def tabbox(*args): """ adds a box with tab params: (widget, title) title is the string """ tab_widget = QtGui.QTabWidget() tab_widget.setMovable(True) tab_widget.setAutoFillBackground(True) #~ tab_widget.setTabShape(QtGui.QTabWidget.Triangular) #~ tab_widget.setTabPosition(QtGui.QTabWidget.West) for box, btitle in args: pane = TabPane() pane.addBox(box) tab_widget.addTab(pane, btitle) return tab_widget