I am tying to implement a custom widget for each column in QHeaderView.

As the QHeaderView is an extension of the QAbstractItemView, the obvious choice would be to implement a custom delegate. But, for QHeaderView, the delegate is explicitely deleted in the source code, so that doesn't (?) seem a viable option.

An other possible method that could work is to reimplement QHeaderView::paintSection() (and maybe even QHeaderView::paintEvent().

My question is whether this latter method is the one to go, or am I overlooking an other obvious method? Some people (for example) are speaking about QWidgets in QHeaderView's constructors, but that doesn't seem to work well, especially if one wants QWidgets for every columnheader as in my case.

Any suggestions?