def parent(self, index: QModelIndex):
    if (not index.isValid()):
        return QModelIndex()
    childItem = index.internalPointer()
    parentItem = childItem.parent()
    if (parentItem == self.mRootItem):
        return QModelIndex()
    return self.createIndex(parentItem.row(), 0, parentItem)
def parent(self, index: QModelIndex):
    if (not index.isValid()):
        return QModelIndex()
    childItem = index.internalPointer()
    parentItem = childItem.parent()
    if (parentItem == self.mRootItem):
        return QModelIndex()
    return self.createIndex(parentItem.row(), 0, parentItem)