Unsolved Does QSqlTableModel::select emit dataChanged/rowsInserted signals?
-
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?
-
@yetanotherqtfan said in Does QSqlTableModel::select emit dataChanged/rowsInserted signals?:
How do I capture the information about the change of the database?
This only works when your driver supports QSqlDriver::EventNotifications - then you can connect to QSqlDriver::notification() which can be triggerd on insert/update/remove with a stored procedure.
-
@yetanotherqtfan said in Does QSqlTableModel::select emit dataChanged/rowsInserted signals?:
then call QSqlTableModel::select to reload the model. I expect dataChanged/rowsInserted signal emitted but it is actually not.
I thought (quite untested) that this would emit
QAbstractItemModel::modelReset()
, because it throws away all existing rows and starts again, so wouldn't bother withdataChanged/rowsInserted
etc.?