def currentCellWidth(self, searchedIndex: QModelIndex, leafIndex: QModelIndex, sectionIndex: int, hv: QHeaderView) -> int: leafsList = QModelIndexList(self.leafs(searchedIndex)) if leafsList.empty(): return hv.sectionSize(sectionIndex) width = 0 firstLeafSectionIndex = sectionIndex - leafsList.indexOf(leafIndex) for i in range(leafsList.size()): width += hv.sectionSize(firstLeafSectionIndex + i) return width
def currentCellLeft(self, searchedIndex: QModelIndex, leafIndex: QModelIndex, sectionIndex: int, left: int, hv: QHeaderView) -> int: leafsList = QModelIndexList(self.leafs(searchedIndex)) if not leafsList.empty(): n = leafsList.indexOf(leafIndex) firstLeafSectionIndex = sectionIndex - n n -= 1 for n in range(n, 0 - 1, -1): left -= hv.sectionSize(firstLeafSectionIndex + n) return left