In pyqt5, using qtreewidget, I'm trying to shift the arrows under the next header. Is this possible? I would like to add a thumbnail to the first column and have the arrows in the second.
This is what I have at the moment.
This is what I get when I shift everything along, the arrows stay under header 0
Mock up of what I want
Striped down example of what I tried.
import sys
from PyQt5.QtWidgets import (QVBoxLayout, QDialog, QTreeWidget, QApplication, QTreeWidgetItem)
class QuickExample(QDialog):
def __init__(self, parent=None):
super(QuickExample, self).__init__(parent)
layout = QVBoxLayout()
tree = QTreeWidget()
tree.setHeaderLabels(["0", "1"])
parent = QTreeWidgetItem()
parent.setText(1, "parent")
child = QTreeWidgetItem(parent)
child.setText(1, "child")
tree.addTopLevelItem(parent)
layout.addWidget(tree)
self.setLayout(layout)
if __name__ == '__main__':
app = QApplication(sys.argv)
example = QuickExample()
example.show()
sys.exit(app.exec_())