#NEWLINE# def visit_InsertTab( self , op ) : #NEWLINE# #INDENT# ' Handle the InsertTab dock layout operation.\n\n        This visitor inserts the dock item as a tab in the layout\n        according to the data specified in the operation.\n\n        ' #NEWLINE# item = self . containers . get ( op . item ) #NEWLINE# if ( item is None ) : #NEWLINE# #INDENT# return #NEWLINE# #UNINDENT# if ( not item . isWindow ( ) ) : #NEWLINE# #INDENT# item . unplug ( ) #NEWLINE# #UNINDENT# target = self . containers . get ( op . target ) #NEWLINE# if ( target is None ) : #NEWLINE# #INDENT# area = self . manager . dock_area ( ) #NEWLINE# if ( area . centralWidget ( ) is None ) : #NEWLINE# #INDENT# guide = QGuideRose . Guide . AreaCenter #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# guide = QGuideRose . Guide . BorderWest #NEWLINE# #UNINDENT# plug_frame ( area , None , item , guide ) #NEWLINE# return #NEWLINE# #UNINDENT# area = target . parentDockArea ( ) #NEWLINE# bar_position = area . dockBarPosition ( target ) #NEWLINE# if ( bar_position is not None ) : #NEWLINE# #INDENT# if item . isWindow ( ) : #NEWLINE# #INDENT# item . unfloat ( ) #NEWLINE# #UNINDENT# item . showTitleBar ( ) #NEWLINE# area . addToDockBar ( item , bar_position ) #NEWLINE# return #NEWLINE# #UNINDENT# with self . dock_context ( target ) : #NEWLINE# #INDENT# area = target . parentDockArea ( ) #NEWLINE# widget = target . parentDockTabWidget ( ) #NEWLINE# if ( widget is None ) : #NEWLINE# #INDENT# widget = target #NEWLINE# guide = self . TAB_GUIDES [ op . tab_position ] #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# guide = QGuideRose . Guide . CompassCenter #NEWLINE# #UNINDENT# plug_frame ( area , widget , item , guide ) #NEWLINE# #UNINDENT# tabs = target . parentDockTabWidget ( ) #NEWLINE# if ( tabs is not None ) : #NEWLINE# #INDENT# index = tabs . indexOf ( item ) #NEWLINE# tabs . tabBar ( ) . moveTab ( index , op . index )