def setFont(self, font): self.font = font # for future use # set the current tree items iterator = QTreeWidgetItemIterator(self) while iterator.value(): item = iterator.value() item.setFont(0, self.font) item.setFont(1, self.font) iterator += 1
def get_data(self): iter = QTreeWidgetItemIterator(self) while iter.value(): item = iter.value() if hasattr(item, 'x') and hasattr(item, 'k'): if item.checkState(0) == Qt.Checked: self.tree_data[item.k][item.x] = True else: self.tree_data[item.k][item.x] = False iter.__iadd__(1) return self.tree_data
def get_visible_items(self): """Return a list of all visible items in the treewidget.""" items = [] iterator = QTreeWidgetItemIterator(self) while iterator.value(): item = iterator.value() if item.parent(): if item.parent().isExpanded(): items.append(item) else: items.append(item) iterator += 1 return items
def get_visible_items(self): """Return a list of all visible items in the treewidget.""" items = [] iterator = QTreeWidgetItemIterator(self) while iterator.value(): item = iterator.value() if not item.isHidden(): if item.parent(): if item.parent().isExpanded(): items.append(item) else: items.append(item) iterator += 1 return items