Вопрос

There is a 1 at the top of a QtreeWidget. How do i fix it?

Это было полезно?

Решение

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.

Другие советы

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))

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top