(self, completion_list, position, automatic)
Show list corresponding to position.
Show list corresponding to position.
Show list corresponding to position .
def show_list(self, completion_list, position, automatic):
        """Show list corresponding to position."""
        if not completion_list:
            self.hide()
            return

        self.automatic = automatic

        if position is None:
            # Somehow the position was not saved.
            # Hope that the current position is still valid
            self.completion_position = self.textedit.textCursor().position()

        elif self.textedit.textCursor().position() < position:
            # hide the text as we moved away from the position
            self.hide()
            return

        else:
            self.completion_position = position

        self.completion_list = completion_list

        # Check everything is in order
        self.update_current()

        # If update_current called close, stop loading
        if not self.completion_list:
            return

        # If only one, must be chosen if not automatic
        single_match = self.count() == 1
        if single_match and not self.automatic:
            self.item_selected(self.item(0))
            # signal used for testing
            self.sig_show_completions.emit(completion_list)
            return

        self.show()
        self.setFocus()
        self.raise_()

        self.textedit.position_widget_at_cursor(self)

        if not self.is_internal_console:
            tooltip_point = self.rect().topRight()
            tooltip_point = self.mapToGlobal(tooltip_point)

            if self.completion_list is not None:
                for completion in self.completion_list:
                    completion['point'] = tooltip_point

        # Show hint for first completion element
        self.setCurrentRow(0)

        # signal used for testing
        self.sig_show_completions.emit(completion_list)
def show_list ( self , completion_list , position , automatic ) : if not completion_list : self . hide ( ) return self . automatic = automatic if position is None : # Somehow the position was not saved. # Hope that the current position is still valid self . completion_position = self . textedit . textCursor ( ) . position ( ) elif self . textedit . textCursor ( ) . position ( ) < position : # hide the text as we moved away from the position self . hide ( ) return else : self . completion_position = position self . completion_list = completion_list # Check everything is in order self . update_current ( ) # If update_current called close, stop loading if not self . completion_list : return # If only one, must be chosen if not automatic single_match = self . count ( ) == 1 if single_match and not self . automatic : self . item_selected ( self . item ( 0 ) ) # signal used for testing self . sig_show_completions . emit ( completion_list ) return self . show ( ) self . setFocus ( ) self . raise_ ( ) self . textedit . position_widget_at_cursor ( self ) if not self . is_internal_console : tooltip_point = self . rect ( ) . topRight ( ) tooltip_point = self . mapToGlobal ( tooltip_point ) if self . completion_list is not None : for completion in self . completion_list : completion [ 'point' ] = tooltip_point # Show hint for first completion element self . setCurrentRow ( 0 ) # signal used for testing self . sig_show_completions . emit ( completion_list )