I have created a QTreeWidget with 4 columns using a Designer. It works but my header columns are "1 2 3 4". I tried setHeaderLabels():
Code:
{ setHeaderLabels(labels); TreeHeader = header(); // TreeHeader is QHeaderView * TreeHeader->setSectionHidden(1,true); TreeHeader->setSectionHidden(2,true); TreeHeader->setSectionHidden(3,true); TreeHeader->setVisible(false); }
(At the beginning: we have no header and only one column in the view.) but I still have columns "1 2 3 4". Perhaps, because setHeaderLabels() adds columns instead of updating them according to the documentation. I have searched something what updates header labels but I have found nothing. How should I set the header labels?