My program is really simple, a kind of address book.
The VACUUM call is done in SLOT and I am certain at this point that there are no other running queries.

For this to work I found this:
Qt Code:
  1. QSqlDatabase db= QSqlDatabase::database();
  2. db.close();
  3. db.open();
  4. QSqlQuery query;
  5. query.exec("VACUUM");
To copy to clipboard, switch view to plain text mode 
Thank you for your advice