Does QSqlQuery release automatically? Qt Version:5.12 DataBase:SQLite
If a
QSqlqueryobject goes out of scope, is it automatically released? Should I useclear()orfinish()to release instead?If I wanna use an
QSqlquerymany times, shoule I useclear()orfinish()to release it? For example:
QSqlQuery theQuery;
theQuery.exec("SELECT * From Table");
theQuery.next();
//some statements at the same scope
//Need to use clear() or finish() at there? (reuse)
theQuery.exec("SELECT * From Table2");
theQuery.next();
//Need to use clear() or finish() at there? (destruct)
return;
- Should I use a global(long existence)
QSqlqueryobject or a temporary one?