Smart thinking.....
Can you use the QSortFilterProxyModel? It is not marked as deprecated / obsolete.
http://qt-project.org/doc/qt-5/qsort...roxymodel.html
Smart thinking.....
Can you use the QSortFilterProxyModel? It is not marked as deprecated / obsolete.
http://qt-project.org/doc/qt-5/qsort...roxymodel.html
I started to suggest this yesterday, but didn't have the time to complete my reply. Glad you tried it and got it to work.I've just tried it and it seems to work with a QAbstractProxymodel and a delegate.
The proxymodel just adds an empty column and the delegate creates an pesistent editor in it (a modified QPushbutton)
QSortFilterProxyModel is not appropriate for this use. It is used in cases where you want to 1) remove certain rows or columns from the source model and / or 2) display the source model sorted in a different order without changing the source model. There are several additional methods that must be implemented in QSortFilterProxyModel which have no relevance to the OP's problem. In his case, he wants to pass the source model unchanged, and simply add a new virtual column with a pushbutton in it. Depending on where he adds the virtual column, he won't have to do anything in QAbstractProxyModel's virtual methods except return QModelIndex instances that map directly to or from the same row and column of the source.Can you use the QSortFilterProxyModel? It is not marked as deprecated / obsolete.
Bookmarks