QAbstractItemModel::Span
-
Hi,
I would like to use:
http://doc.trolltech.com/4.7/qabstractitemmodel.html#span, but it says "Note: Currently, span is not used."I have looked into previous releases, and it seems that span has been unimplemented for a long time. Why is this the case? Is there any way around this if I want to add something that will span multiple columns?
Thanks,
Marc -
The API is there in QAbstractItemModel from the start (since it's virtual, it couldn't have been added at a later point), but indeed no views implement it.
I used span() in KDReports (http://www.kdab.com/products/kd-reports), which creates tables in a report (using QTextDocument internally), in order to support spans.
But as long as QTableView does not implement it, you don't really have a solution for a tableview. All you can do is vote on http://bugreports.qt.nokia.com/browse/QTBUG-6508 :-)
-
Ah, I forgot: currently to achieve span in QTableView you can use:
void QTableView::setSpan ( int row, int column, int rowSpanCount, int columnSpanCount )This is not as nice as having this information come from the model, but it's a way to get things done.
Not available in a QTreeView though (you didn't specify which one you were using).
-
Ah OK, then it's rather http://bugreports.qt.nokia.com/browse/QTBUG-2117 that you want to vote for :-)