#NEWLINE# def visit_DockLayout( self , node ) : #NEWLINE# #INDENT# " Visit a DockLayout node.\n\n        This visitor assemble a new layout from scratch for the dock\n        manager. It is only invoked from the 'apply_layout' method of\n        the dock manager when a completely new layout is being applied.\n\n        " #NEWLINE# manager = self . manager #NEWLINE# for container in manager . dock_containers ( ) : #NEWLINE# #INDENT# container . reset ( ) #NEWLINE# #UNINDENT# for window in manager . dock_windows ( ) : #NEWLINE# #INDENT# window . close ( ) #NEWLINE# #UNINDENT# dock_area = manager . dock_area ( ) #NEWLINE# dock_area . clearDockBars ( ) #NEWLINE# dock_area . setCentralWidget ( None ) #NEWLINE# has_primary = False #NEWLINE# for item in node . items : #NEWLINE# #INDENT# if isinstance ( item , AreaLayout ) : #NEWLINE# #INDENT# if ( ( not item . floating ) and ( not has_primary ) ) : #NEWLINE# #INDENT# self . init_dock_area ( dock_area , item ) #NEWLINE# has_primary = True #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# frame = QDockWindow ( manager , dock_area ) #NEWLINE# self . init_dock_area ( frame . dockArea ( ) , item ) #NEWLINE# manager . add_window ( frame ) #NEWLINE# self . init_floating_frame ( frame , item ) #NEWLINE# #UNINDENT# #UNINDENT# else : #NEWLINE# #INDENT# frame = self . containers . get ( item . name ) #NEWLINE# if ( frame is not None ) : #NEWLINE# #INDENT# frame . float ( ) #NEWLINE# self . init_floating_frame ( frame , item )