nando
11th February 2008, 08:54
Hi everybody,
i have a problem with sorting in my view:
i have implemented my own view (inherited from QAbstractItemView) and my own model (inherited from QAbstractItemModel) and my own Proxy (inherited from QSortFilterProxyModel).
Everything like inserting data, updating and removing data works fine.
Now i want to add sorting, so i reimplemented the proxy's lessThan method.
If i trigger a sort by calling:
pView->model()->sort(colIndex);
i see the proxy's lessThan method is called as expected,
but my view do not update (reorder) its contents.
If i connect a standard QTableView to my proxy and then enable sorting and then click on an cell-header,
i also see the proxy's lessThan method is called
and the table displays the reordered data correctly
so i think i have missed something in my own view implementation, but i don't know what?
Does somebody has done this already?
Greetings,
Nando
i have a problem with sorting in my view:
i have implemented my own view (inherited from QAbstractItemView) and my own model (inherited from QAbstractItemModel) and my own Proxy (inherited from QSortFilterProxyModel).
Everything like inserting data, updating and removing data works fine.
Now i want to add sorting, so i reimplemented the proxy's lessThan method.
If i trigger a sort by calling:
pView->model()->sort(colIndex);
i see the proxy's lessThan method is called as expected,
but my view do not update (reorder) its contents.
If i connect a standard QTableView to my proxy and then enable sorting and then click on an cell-header,
i also see the proxy's lessThan method is called
and the table displays the reordered data correctly
so i think i have missed something in my own view implementation, but i don't know what?
Does somebody has done this already?
Greetings,
Nando