def __transferSelectionFromContext(self): selection = ContextAlgo.getSelectedPaths(self.getContext()) with Gaffer.BlockedConnection(self.__selectionChangedConnection): self.__pathListing.setSelection(selection, scrollToFirst=True, expandNonLeaf=False)
def __transferSelectionFromContext( self ) : selection = ContextAlgo.getSelectedPaths( self.getContext() ).paths() with Gaffer.BlockedConnection( self.__selectionChangedConnection ) : ## \todo Qt is dog slow with large non-contiguous selections, # so we're only mirroring single selections currently. Rewrite # PathListingWidget so it manages selection itself using a PathMatcher # and we can refer to the same data structure everywhere, and reenable # mirroring of multi-selection. if len( selection ) == 1 : p = self.__pathListing.getPath() selection = [ p.copy().setFromString( s ) for s in selection ] self.__pathListing.setSelectedPaths( selection, scrollToFirst=True, expandNonLeaf=False ) else : self.__pathListing.setSelectedPaths( [] )
def __transferSelectionFromContext(self): selection = ContextAlgo.getSelectedPaths(self.getContext()).paths() with Gaffer.BlockedConnection(self.__selectionChangedConnection): ## \todo Qt is dog slow with large non-contiguous selections, # so we're only mirroring single selections currently. Rewrite # PathListingWidget so it manages selection itself using a PathMatcher # and we can refer to the same data structure everywhere, and reenable # mirroring of multi-selection. if len(selection) == 1: p = self.__pathListing.getPath() selection = [p.copy().setFromString(s) for s in selection] self.__pathListing.setSelectedPaths(selection, scrollToFirst=True, expandNonLeaf=False) else: self.__pathListing.setSelectedPaths([])
def __transferSelectionFromContext( self ) : selection = ContextAlgo.getSelectedPaths( self.getContext() ) with Gaffer.BlockedConnection( self.__selectionChangedConnection ) : self.__pathListing.setSelection( selection, scrollToFirst=True, expandNonLeaf=False )