#NEWLINE# def visit_TabLayout( self , node ) : #NEWLINE# #INDENT# ' Visit a TabLayout node.\n\n        This visitor visits its children, pops them from the stack, and\n        adds them to a tab widget. The completed tab widget is pushed\n        onto the stack as the return value. If there are no children,\n        None is pushed. If there is a single child, it is pushed.\n\n        ' #NEWLINE# children = [ ] #NEWLINE# for item in node . items : #NEWLINE# #INDENT# self . visit ( item ) #NEWLINE# children . append ( self . stack . pop ( ) ) #NEWLINE# #UNINDENT# children = filter ( None , children ) #NEWLINE# if ( len ( children ) == 0 ) : #NEWLINE# #INDENT# self . stack . append ( None ) #NEWLINE# return #NEWLINE# #UNINDENT# if ( len ( children ) == 1 ) : #NEWLINE# #INDENT# self . stack . append ( children [ 0 ] ) #NEWLINE# return #NEWLINE# #UNINDENT# tab_widget = QDockTabWidget ( ) #NEWLINE# tab_widget . setTabPosition ( self . TAB_POSITION [ node . tab_position ] ) #NEWLINE# for child in children : #NEWLINE# #INDENT# child . hideTitleBar ( ) #NEWLINE# tab_widget . addTab ( child , child . icon ( ) , child . title ( ) ) #NEWLINE# #UNINDENT# tab_widget . setCurrentIndex ( node . index ) #NEWLINE# self . stack . append ( self )