I modify database externally then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not. How do I capture the information about the change of the database?
I modify database externally then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not. How do I capture the information about the change of the database?
The model is probably sending layoutChanged() and/or modelReset() signals since the result of a query generally means the entire content of the model has changed.
The other signals imply that most of the model is unchanged, only the rows / columns / data ranges notified in the signal are modified. That's not the case here, and if the new results have a different number of rows than the previous, it could cause views to malfunction.
Last edited by d_stranz; 16th March 2020 at 16:54.
<=== The Great Pumpkin says ===>
Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.
Bookmarks