PDA

View Full Version : Editable table header



bbarran
28th June 2007, 17:59
I'm using a subclass of QAbstractTableModel to help edit some table information. Editing the contents of the table by overriding flags() seems fine but I can't edit the horizontal table header (ie rename the columns). What's the trick for doing this?

jpn
28th June 2007, 22:28
I'm using a subclass of QAbstractTableModel to help edit some table information. Editing the contents of the table by overriding flags() seems fine but I can't edit the horizontal table header (ie rename the columns). What's the trick for doing this?
Unfortunately there is no straightforward trick to do this. One needs both custom header view and item delegate to achieve editable headers. I have attached an example how I did it. Comments are more than welcome. ;)

bbarran
17th July 2007, 21:52
Thanks for the example jpn. I've worked around it already and now have experience implementing custom delegates so I'll think I'll go back and do something similar to you.

Davor
8th July 2010, 12:14
Any chance of posting the archive back or copy-pasting the code?

The archive seems corrupt...

Regards,
Davor

Andriy
9th December 2010, 11:26
I will be very thankful if somebody provide an example with editable table header.

Thanks