I think I've found problem. Here we've got code:
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();
}
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();
}
To copy to clipboard, switch view to plain text mode
And now my question - why if I close my database without clearing QSqlQueryModel strange things happens (data is still there but memory usage is still growing up each time function is executed)? I need to close database for other programs but i need to use data that I've just read from database to QSqlQueryModel.
thanks in advance
best regards
Tomasz
Bookmarks