code: def indexTupleFromItem(self, treeItem): # TODO: move to BaseTreeItem?
          
          if not treeItem:
              return (QtCore.QModelIndex(), QtCore.QModelIndex())
  
          if not treeItem.parentItem: # TODO: only necessary because of childNumber?
              return (QtCore.QModelIndex(), QtCore.QModelIndex())
  
          # Is there a bug in Qt in QStandardItemModel::indexFromItem?
          # It passes the parent in createIndex. TODO: investigate
  
          row =  treeItem.childNumber()
          return (self.createIndex(row, 0, treeItem),
                  self.createIndex(row, self.columnCount() - 1, treeItem))
docs: Return (first column model index, last column model index) tuple for a configTreeItem