I was also looking for a solution to this problem. I found this class: HierarchicalHeaderView on qt-apps.org by Barmaglodd (Krasnoshchekov Petr).
This decision goes beyond what you (and I) need. In addition, I cannot use their solution because of their copyright notice.
This post from blog.qt.digia.com by Andy Shaw shows you how to overlay QComboBoxes on the title. In my decision, I did the same with a different header. This is similar to how they imposed a QTableView on a QTableView for an example Qt Frozen column . For this solution, you need to subclass QTableWidget and QHeaderView. Also, if you want the user to customize the column width, which requires additional work.
Tip. Overload SizeHint to get a 2x height of the normal height of the main heading, align the main heading text down and draw another headerview on top of the usual one, do it further
showEvent(QShowEvent* e)
method.
jtooker
source share