Why is there a 1 at the top of a QTreeWidget?
-
20-04-2021 - |
Question
There is a 1 at the top of a QtreeWidget. How do i fix it?
Solution
The value 1
is the columncount
property, that, by default, assumes that value.
Your question was not very clear.
If you want to modify the label, you can use setHeaderLabel/setHeaderLabels functions.
If you want to hide the label, you can use setHeaderHidden function.
Please, before ask, use the Qt documentation.
OTHER TIPS
By default qt designer puts 1 there, you need to edit it to suit your need from within qt designer or programatically using the docs.
This wll change the title of qlistwidget:
self.treeWidget.headerItem().setText(0, QtGui.QApplication.translate("Dialog", "xyz", None, QtGui.QApplication.UnicodeUTF8))
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow