code: def setCurrentIndex(self, currentIndex):
          
          selectionModel = self.selectionModel()
          selectionFlags = (QtCore.QItemSelectionModel.ClearAndSelect |
                            QtCore.QItemSelectionModel.Rows)
          selectionModel.setCurrentIndex(currentIndex, selectionFlags)
docs: Sets the current item to be the item at currentIndex.
              Also select the row as to give consistent user feedback.
              See also the notes at the top of this module on current item vs selected item(s).