0

Basically as title says. Is there a way to hide a column in QTreeWidgetItem?

I have multiple hierarchies that goes like this:

Top Label 1
  |
  |—-> Child Label
         |
         |—-> Table

Top Label 2
  |
  |—-> Child Label
         |
         |—-> Table

I have a few columns in my table and I want to hide a specific column in ALL hierarchies. However, QTreeWidgetItem doesn’t have a setColumnHidden. How do I go about hiding a column in the table?

39kura
  • 13
  • 3
  • QTreeWidget inherits from QTreeView (always look for the inheritance in the [documentation header](https://doc.qt.io/qt-5/qtreewidget.html)), which *does* have [`setColumnHidden()`](https://doc.qt.io/qt-5/qtreeview.html#setColumnHidden). Also, don't confuse QTreeWidget and QTreeWidgetItem: the former is the *view*, the latter is the abstract representation of one of its items. – musicamante Apr 09 '23 at 23:23

0 Answers0