qtreewidget

What is the method to set the text for a QTreeWidget's header?

天涯浪子 提交于 2019-11-27 07:36:46
问题 I've checked the documentation here and I can't seem to find a method for setting the text of a QTreeWidget's title or header. Without setting the title QTreeWidget automatically uses the number '1' in my code. An example of what it looks like outputted is below. I'm presuming QTreeWidget has a method for this and I just can't find it. 回答1: You're looking for setHeaderLabel. Note that the documentation says it adds a new column, so if your view already has column 0 with text "1", you may