controls in WTableView header?
Added by Tristan Hooper over 14 years ago
Hey,
was wondering if there is a way to add controls to the header of the WTableView.
basically what I'm wanting to do is implement a select all/ select none, a good example of this would be similar to the way gmail would allow you to select all email, select none.
Currently I change the WTableView header height to 0 and then I add the appropriate controls, labels above the table.
Just seems like there might be a better way to do this.
Replies (3)
RE: controls in WTableView header? - Added by Koen Deforche over 14 years ago
Hey Tristan,
I don't think there is currently a good way. You can define extra widgets to be rendered in the header (see WAbstractItemView::createExtraHeaderWidget()) but they are rendered under the actual header. You would want the select all/none e.g. to be rendered in the header line itself.
I believe that the proper way to solve this is by allowing also a WItemDelegate to render the header cell. Then, the rendering of the header can be customized just as the rendering of each cell.
Does that sound like a good solution to you ?
Regards,
koen
RE: controls in WTableView header? - Added by saxon zhang over 14 years ago
How to render the header cell by the WItemDelegate ?
I just know how to render the data items. What method is use for it ?
RE: controls in WTableView header? - Added by Koen Deforche over 14 years ago
I take it that is a "I second that" for having such a method: currently you cannot customize the header cell rendering.
I've created a feature request for this: http://redmine.emweb.be/issues/654
Regards,
koen