PDA

View Full Version : Custom QHeaderView



y.s.bisht
4th January 2012, 20:47
Hi All,

I want to create a custom QHeaderView for my QTreeView, It should hide the column exactly it does in VisualStudio (Attached Image). User click at down arrow provided at right most portion of Header and a context menu containing all column items should popup and user can toggle it's view (hide/show) by selecting and deselecting the item in the menu.

I am clueless how to start this, I will highly appreciate any help or example.

Thanks in advance

wysota
4th January 2012, 23:28
In the image you provided the "header" is not really a header, it is a toolbar. The table is headerless and there is a toolbar over it. If you place a toolbar over a table and make sure sizes of the two widgets are synced, you'll get the same behaviour.

aisabellafontes
24th January 2012, 20:43
Hi,

I have the same problem as y.s.bisht, but with some differences:
I use a QTreeWidget and I want each column header of this TreeWidget showing a title and besides it a ToolButton. Do I need a delegate class??

wysota
24th January 2012, 21:27
QHeaderView doesn't use delegates.