[Interest] mapping headerData to a source model
pengland at cmt-asia.com
Thu Nov 15 06:36:00 CET 2012
Okay, after writing a small example I think I'm grasping how
model->proxy->delegate->view all operate together. Hoewver, I have
found a single caveat that I haven't been able to figure out:
For my QSortFilterProxyModel, I'm using mapToSource( const QModelIndex&
) to magically get the "real" index back from the model. However, I
don't see anything similar corresponding to headerData(). The result
is, if I have columns 0-4 in a QTableView, and then block column 2 with
QSortFilterProxyModel::filterAcceptsColumn(), my data in the cells is
displayed properly. However, the headers will now say 0,1,2,3 intstead
I feel I'm missing something rather easy here.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Interest