[Qt-interest] QTableView and spans

Lars Amsel lars.amsel at signalion.com
Wed Aug 12 11:20:02 CEST 2009


Alex,

as Stephen stated there is already a method called span in the 
QAbstractItemModel, but it is not used so far (I tried with Qt 4.5.2).

At the end of the day I have a structure with a top level and exactly one 
child level.

One way would be to implement the model like any other with indefinite depth. 
But then things get complicated on the view side. Display this structure with 
spans on a table view means rewriting the QTableView.
On the other hand I could write a model that presents the data in a flat view 
as QAbstractTable model. But that makes the model ugly to read and furthermore 
I still have to set the spans on the view side.

I was hoping that I have overseen an easy solution, but obviously there isn't 
such a solution.

regards

Lars



More information about the Qt-interest-old mailing list