code: def indexFromItem(self, regItem, col=0):
          
          if col < 0:
              col = len(self.attrNames) - col
          try:
              row = self.registry.items.index(regItem)
          except ValueError:
              return QtCore.QModelIndex()
          else:
              return self.index(row, col)
docs: Gets the index (with column=0) for the row that contains the regItem
              If col is negative, it is counted from the end