QT GUI Tab Widget qtgui_tab_widget QT GUI Widgets from PyQt4 import Qt #set $win = 'self.%s'%$id Qt.QTabWidget() #set $all_labels = [$label0, $label1, $label2, $label3, $label4][:int($num_tabs())] #for i, label in enumerate($all_labels) self.$(id)_widget_$(i) = Qt.QWidget() self.$(id)_layout_$(i) = Qt.QBoxLayout(Qt.QBoxLayout.TopToBottom, self.$(id)_widget_$(i)) self.$(id)_grid_layout_$(i) = Qt.QGridLayout() self.$(id)_layout_$(i).addLayout(self.$(id)_grid_layout_$(i)) $(win).addTab(self.$(id)_widget_$(i), $label) #end for $(gui_hint()($win)) Num Tabs num_tabs 1 enum Label 0 label0 Tab 0 string #if int($num_tabs()) > 0 then 'none' else 'all'# Label 1 label1 Tab 1 string #if int($num_tabs()) > 1 then 'none' else 'all'# Label 2 label2 Tab 2 string #if int($num_tabs()) > 2 then 'none' else 'all'# Label 3 label3 Tab 3 string #if int($num_tabs()) > 3 then 'none' else 'all'# Label 4 label4 Tab 4 string #if int($num_tabs()) > 4 then 'none' else 'all'# GUI Hint gui_hint gui_hint part This block creates a tabbed widget to organize other widgets. \ The ID of this block can be used as the tab_id in the GUI hints of other widgets. The GUI hint can be used to position the widget within the application. \ The hint is of the form [tab_id@tab_index]: [row, col, row_span, col_span]. \ Both the tab specification and the grid position are optional.