Wysota and helpers,
i did as you said..reimplement headerData ()....the thing is that i found the solution but i cant understand it, not even reading the documentation :P
here is what i found and totally works
QVariant MySortModelFilter
::headerData(int section, Qt
::Orientation orientation,
int role
) const {
if (role != Qt::DisplayRole)
if (orientation == Qt::Horizontal)
return section + 1;
}
QVariant MySortModelFilter::headerData(int section, Qt::Orientation orientation, int role) const
{
if (role != Qt::DisplayRole)
return QVariant();
if (orientation == Qt::Horizontal)
return QSortFilterProxyModel::headerData(section, orientation, role);
return section + 1;
}
To copy to clipboard, switch view to plain text mode
i know that the section is the row number and i understand that if we are talking about horizontal headers the process delegates it to the same function in proxymodel...
what i dont understand is the +1 and the return of QVariant ();
hope someone can bring some light to this burned head
Bookmarks