code: def _onCompletionListItemSelected(self, index):
          
          model = self._widget.model()
          selectedWord = model.words[index]
          textToInsert = selectedWord[len(model.typedText()):]
          self._qpart.textCursor().insertText(textToInsert)
          self._closeCompletion()
docs: Item selected. Insert completion to editor