qtreewidget

QTreeWidget clear empty space at the bottom of widget

QTreeWidget clear empty space at the bottom of widget Question: Is this example i have a QTreeWidget with 4 columns. The last column is filled by QFrames. File ui.py from PyQt5 import QtCore, QtGui, QtWidgets import sys if __name__ == "__main__": app = QtWidgets.QApplication(sys.argv) app.setStyle("Windows") treeWidget = QtWidgets.QTreeWidget() treeWidget.headerItem().setText(0, "Α/Α") treeWidget.headerItem().setText(1,"Τύπος") treeWidget.headerItem().setText(2,"Τίτλος") treeWidget.headerItem().setText(3,"Προεπισκόπιση") treeWidget.setStyleSheet("QTreeWidget::item{height:60px;}") l …

Total answers: 1

Partially coloring text of QTreeWidgetItem

Partially coloring text of QTreeWidgetItem Question: I am trying to get part of the text of a QTreeWidgetItem to be set to red and have found a few examples, namely how to set the background color of part of the text in qtreewidgetitem and is it possible to partially italicize the text of a qtreewidgetitem, …

Total answers: 1

QTreeWidget to Mirror python Dictionary

QTreeWidget to Mirror python Dictionary Question: Is there a way to make a QTreeWidget mirror the changes made to an internal data structure such as dictionary? It seems like they would have created this functionality within the api, because there are many programs which may interact with QTreeWidgets from multiple GUI areas, but the main …

Total answers: 5

Delete QTreeWidgetItem in PyQt?

Delete QTreeWidgetItem in PyQt? Question: I’m finding it frustratingly hard to find a simple way to delete my selected QTreeWidgetItem. My patchwork method involves setting the tree’s current selection to current and then: if current.parent() is not None: current.parent().removeChild(current) else: self.viewer.takeTopLevelItem(self.viewer.indexOfTopLevelItem(current)) It’s not horrible, but isn’t there a command that straight up just removes the …

Total answers: 3