#NEWLINE# def __show( self ) : #NEWLINE# #INDENT# self . __build ( self . _qtWidget ( ) ) #NEWLINE# if self . __searchable : #NEWLINE# #INDENT# self . __searchStructure = { #NEWLINE# #INDENT# #NEWLINE# #UNINDENT# } #NEWLINE# self . __initSearch ( self . _qtWidget ( ) . __definition ) #NEWLINE# searchWidget = QtGui . QWidgetAction ( self . _qtWidget ( ) ) #NEWLINE# searchWidget . setObjectName ( 'GafferUI.Menu.__searchWidget' ) #NEWLINE# self . __searchMenu = _Menu ( self . _qtWidget ( ) , '' ) #NEWLINE# self . __searchMenu . aboutToShow . connect ( Gaffer . WeakMethod ( self . __searchMenuShow ) ) #NEWLINE# self . __searchLine = QtGui . QLineEdit ( ) #NEWLINE# self . __searchLine . textEdited . connect ( Gaffer . WeakMethod ( self . __updateSearchMenu ) ) #NEWLINE# self . __searchLine . returnPressed . connect ( Gaffer . WeakMethod ( self . __searchReturnPressed ) ) #NEWLINE# self . __searchLine . setObjectName ( 'search' ) #NEWLINE# if hasattr ( self . __searchLine , 'setPlaceholderText' ) : #NEWLINE# #INDENT# self . __searchLine . setPlaceholderText ( 'Search...' ) #NEWLINE# #UNINDENT# if self . __lastAction : #NEWLINE# #INDENT# self . __searchLine . setText ( self . __lastAction . text ( ) ) #NEWLINE# self . __searchMenu . setDefaultAction ( self . __lastAction ) #NEWLINE# #UNINDENT# self . __searchLine . selectAll ( ) #NEWLINE# searchWidget . setDefaultWidget ( self . __searchLine ) #NEWLINE# firstAction = ( self . _qtWidget ( ) . actions ( ) [ 0 ] if len ( self . _qtWidget ( ) . actions ( ) ) else None ) #NEWLINE# self . _qtWidget ( ) . insertAction ( firstAction , searchWidget ) #NEWLINE# self . _qtWidget ( ) . insertSeparator ( firstAction ) #NEWLINE# self . _qtWidget ( ) . setActiveAction ( searchWidget ) #NEWLINE# self . __searchLine . setFocus ( )