Dear DanH,
No Way I added the finish() function before to close database connection, but no way, the file is still lock. These are my functions:
[...]
void myThread1::clearDBConn(){
qry->finish();
db.close();
}
void myThread1::zipDB(){
zipName=nomeDB;
clearDBConn();
archive(zipName.replace(".s3db",".zip"),nomeDB,true);
emit zipFileName(idProva, zipName);
//delName=QDir().absoluteFilePath(nomeDB);
}
[...]
void myThread1::clearDBConn(){
qry->finish();
db.close();
db.~QSqlDatabase();
QSqlDatabase::removeDatabase(nomeDB);
}
void myThread1::zipDB(){
QString zipName,delName;
zipName=nomeDB;
clearDBConn();
archive(zipName.replace(".s3db",".zip"),nomeDB,true);
emit zipFileName(idProva, zipName);
//delName=QDir().absoluteFilePath(nomeDB);
QFile(nomeDB).remove();
}
To copy to clipboard, switch view to plain text mode
Is there something wrong?
Thanks for your time
Michele
Bookmarks