edice
24th September 2009, 03:11
Hi,
I have a QTreeView and a custom model.
I would like all of my root nodes to have their first column spanned. How do I do it?
I see there is QTreeView::isFirstColumnSpanned(), but its virtual so I can't override that. I can only use
QTreeView::setFirstColumnSpanned(int row, QModelIndex, bool), but that means I need to know in advance how many rows my model has, AND get all their indexes, then call this function multiple times. And then do it again whenever I change the model's contents.
Seems like a crazy design? Why isn't there a 'FirstColumnSpannedRole' or something like that? There are all sorts of other display-orientated roles that I could use.
thanks,
Paul
I have a QTreeView and a custom model.
I would like all of my root nodes to have their first column spanned. How do I do it?
I see there is QTreeView::isFirstColumnSpanned(), but its virtual so I can't override that. I can only use
QTreeView::setFirstColumnSpanned(int row, QModelIndex, bool), but that means I need to know in advance how many rows my model has, AND get all their indexes, then call this function multiple times. And then do it again whenever I change the model's contents.
Seems like a crazy design? Why isn't there a 'FirstColumnSpannedRole' or something like that? There are all sorts of other display-orientated roles that I could use.
thanks,
Paul