I placed QTreeWidget into QVBoxLayout.
self._tree = QTreeWidget()
layout = QVBoxLayout()
layout.addWidget(self._some_other_widget)
layout.addWidget(self._tree)
layout.addStretch()
self.setLayout(layout)
All nodes in this tree widget are always expanded. I would like to create this tree widget with minimal height (for example, for one row/item). When new items are added this tree widget also grows to show all items. How can this be done? Thank you in advance.
self._tree.setSizeAdjustPolicy(QAbstractScrollArea.AdjustToContents)
? – G.M.