I am trying to build a windows explorer like application with Qt4. On the left side there is a tree, the right side contains a list. The list uses a QTreeView to display the columns. My problem are the column headings: depending on the selected node in the tree there are distinct column headers in the list. Since QAbstractItemModel::headerData has no dependency on a QModelIndex (like columnCount), my solution was to let headerData return the union of all possible column headers and to hide the ones that are not needed for the current node( with a class derived from QHeaderView). There remains on problem: the sequence of columns is the same for all nodes (I can’t have “Name|Color|Size” for one node and “Color|Name|Date” for another). Has anybody implemented something like that and knows a solution?