Hello!

I've wrote application with some functions which uses SQL database. I each function I open and read my database like this:

Qt Code:
  1. QSqlDatabase bdb = QSqlDatabase::addDatabase("QSQLITE");
  2.  
  3. bdb.setDatabaseName("/home/mydatabase.db");
  4. ok = bdb.open();
  5.  
  6. if (ok)
  7. {
  8. out << endl << "OK!" << endl ;
  9. } else {
  10. out << "Error!" << endl;
  11. }
  12.  
  13. QSqlQueryModel *queryModel = new QSqlQueryModel;
  14. queryModel->setQuery("SELECT * FROM some_tab where some_field='something'", bdb);
  15.  
  16. //some code...
  17.  
  18. bdb.close();
To copy to clipboard, switch view to plain text mode 

but I get warnings like this in my console:

Qt Code:
  1. QSqlDatabasePrivate::removeDatabase: connection 'qt_sql_default_connection' is still in use, all queries will cease to work.
  2. QSqlDatabasePrivate::addDatabase: duplicate connection name 'qt_sql_default_connection', old connection removed.
To copy to clipboard, switch view to plain text mode 

Is it something wrong? Everything works fine, but maybe I should do it in other way?

thanks in advance
best regards
Tomasz