PDA

View Full Version : How can i set a delegate on header in table



ankurjain
16th May 2006, 13:07
Hi all,
i want to set a combo delegate on header. i used


horizontalHeader()->setItemDelegate(new ComboDelegate)

but i couldn't get it on header.

how can i set it ?

jpn
16th May 2006, 14:04
QHeaderView doesn't seem to use delegates.

And unfortunately it seems like QHeaderView doesn't lay it's index widgets correctly:


QModelIndex idx = horizontalHeader()->model()->index(0, column);
horizontalHeader()->setIndexWidget(idx, someWidget);

The widget will be there, but it's position is (0,0) and size (0,0). So you will have to resize and move it manually.

This could be, in my opinion, reported to Trolltech..