bool QSqlDatabase::commit()
Commits a transaction to the database if the driver supports transactions and a transaction() has been started. Returns true if the operation succeeded. Otherwise it returns false.
Note: For some databases, the commit will fail and return false if there is an active query using the database for a SELECT. Make the query inactive before doing the commit.
这里的Note:说有些数据库在提交前必须先将query 置为无效,用clear()或finish()。 那说的数据库时哪些数据库啊?
有没有关于事务处理的样例代码参考一下。