#NEWLINE# @ contextmanager #NEWLINE# def drop_frame( self , frame ) : #NEWLINE# #INDENT# ' Setup a drop context for a QDockFrame.\n\n        This context manager prepares a QDockFrame to be dropped onto\n        a dock area or dock container. It ensures that a dock window is\n        cleaned up after the docking operation and that the appropriate\n        event is emitted on the object.\n\n        Parameters\n        ----------\n        window : QDockFrame\n            The dock frame of interest.\n\n        ' #NEWLINE# if isinstance ( frame , QDockWindow ) : #NEWLINE# #INDENT# win_area = frame . dockArea ( ) #NEWLINE# maxed = win_area . maximizedWidget ( ) #NEWLINE# if ( maxed is not None ) : #NEWLINE# #INDENT# container = self . containers . get ( maxed . objectName ( ) ) #NEWLINE# if ( container is not None ) : #NEWLINE# #INDENT# container . showNormal ( ) #NEWLINE# #UNINDENT# #UNINDENT# #UNINDENT# ( yield ) #NEWLINE# if ( isinstance ( container , QDockWindow ) and ( frame . dockArea ( ) is None ) ) : #NEWLINE# #INDENT# frame . close ( ) #NEWLINE# #UNINDENT# else : #NEWLINE# #INDENT# if ( not frame . isWindow ( ) ) : #NEWLINE# #INDENT# self . post_docked_event ( frame )