'Return an source QModelIndex for the given key.'

def _indexFromKey(self, key_path):

    index = self.sourceModel().index(key_path[0], 0)
    for row in key_path[1:]:
        index = index.child(row, 0)
    return index
