<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def setCurrentRegItem(self, regItem):
 """ Sets the current registry item. """

        rowIndex = self.model().indexFromItem(regItem)
        if not rowIndex.isValid():
            logger.warn("Can't select {!r} in table".format(regItem))
        self.setCurrentIndex(rowIndex)