Regarding overwritting the existing data in the QSqlRelationalTableModel
-
wrote on 18 Aug 2016, 08:06 last edited by Sudo007
Qt 4.8
Does the QSqlRelationalTableModel::setFilter() overwrite the existing data in the model?
myModelModel->setFilter( QString("QueueID=%1 LIMIT %2 ,%3")
.arg( m_QueueId )
.arg( fromIndex )
.arg( toIndex ) );
if i call the myModelModel->rowCount(), it gives the total no. (existing + after filtered out).how to get overwritting, i want rowCount of the model same always.
-
wrote on 18 Aug 2016, 08:47 last edited by
QSqlRelationalTableModel::setFilter() works calling a select so it will rebuild the model. You could use or subclass QSortFilterProxyModel to do the filtering and retain the original model
-
QSqlRelationalTableModel::setFilter() works calling a select so it will rebuild the model. You could use or subclass QSortFilterProxyModel to do the filtering and retain the original model
-
wrote on 18 Aug 2016, 09:24 last edited by
yes, calling setfilter will call select using the filter argument as WHERE clause so resetting the whole model
4/4