PDA

View Full Version : spaning the headers in the QTableView



ru_core
13th April 2008, 17:34
Hello everybody,

I have the task to create the table (QTableView) as it is shown in attachment

I can span the cells but at the same way I need to span the headers. Because spanning the cells (in the row or in the column) the table has unspaned headers.
Do you have an idea of how to span the headers?

wysota
13th April 2008, 17:55
Default headers cannot be spanned.

ru_core
13th April 2008, 17:58
ok but what way can I solve my task?
Do you have any ideas?

ru_core
13th April 2008, 18:00
merging the cells is impossible in the QTableView object, isn't it?

wysota
13th April 2008, 18:03
Spanning is merging. If you want to do something with the header, you need to subclass QHeaderView.

ru_core
13th April 2008, 18:43
http://troll.no/developer/knowledgebase/faq.2007-09-26.7736043425/
it works!!!!


P.S. Copy and paste :)

alfaalfa
11th June 2013, 14:17
I also want to span two column, the link above is not valid anymore, can somebody point to some sample code to span headers.