What did you try so far?

QHeaderView is not a full-featured item view, which means you cannot use index widgets, editors or anything like that. I'm afraid you will have to keep the widget in the right location on your own. QHeaderView provides plenty of information about section geometries and their changes so it shouldn't be a problem.