Tomasz
6th September 2010, 00:03
Hello!
I've got code like this:
ok = bdb.open();
if (ok)
{
queryModel.clear();
queryModel.setQuery("SELECT * FROM notifi WHERE complete='0'", bdb);
queryModel.clear(); // <----- with this everything is OK
bdb.close();
}
Of course code is more complicated. In future I need to change QSqlQueryModel to QSqlQuery but still... as I mentioned in other thread - strange things happen when I close database before clearing QSqlQueryModel, so is there any way to save somehow results from that QSqlQueryModel (maybe in other object)? I don't want to leave database opened while I'm working with data that I've just read.
thanks in advance
best regards
Tomsz
I've got code like this:
ok = bdb.open();
if (ok)
{
queryModel.clear();
queryModel.setQuery("SELECT * FROM notifi WHERE complete='0'", bdb);
queryModel.clear(); // <----- with this everything is OK
bdb.close();
}
Of course code is more complicated. In future I need to change QSqlQueryModel to QSqlQuery but still... as I mentioned in other thread - strange things happen when I close database before clearing QSqlQueryModel, so is there any way to save somehow results from that QSqlQueryModel (maybe in other object)? I don't want to leave database opened while I'm working with data that I've just read.
thanks in advance
best regards
Tomsz