ItemView (QHeaderView)
Hi there, can any one please give me some code snippet how can I add a combBox in my listview header.
I am also thinking since qheaderview is a widget why cant I subclass it and put combobox in layout and set that layout in this header? or am I thinking weird
4 replies
@Gerolf: Indeed me too realized it is weired idea. so I endup writing itemDelegate and re implemented few virtual function including createEditor() and returned comboBox as editor but this has no effect but then I read the details of the Qt document of Qheaderview and that says that itemDelegate will not work with headerview.
Now I am lost, only thing I can read here and there is to paint the section but I dont know how to do that and even if I manage to paint who is going to manage the items of the combobox and many other signals and slot etc of a general combobox you can think of.
Guys any idea? code snippet ? example? pointer?
Indeed, Gerolf’s suggestion was off. You cannot use delegates for header views.
The only thing you can do, is create the combo box as a child of the HeaderView, and position it manually. QHeaderView has some functions that allow you to figure out where each section of the header is, and what their sizes are.
You must log in to post a reply. Not a member yet? Register here!


