Quote Originally Posted by Lykurg View Post
On startup open the database one time and everywhere you need it get the connection via the static QSqlDatabase::database(). If you wish give a name to the connection so you can have connections the different databases.
What do You mean? I always do:

Qt Code:
  1. QSqlDatabase bdb = QSqlDatabase::addDatabase("QSQLITE");
  2.  
  3. bdb.setDatabaseName(_PATH_TO_MY_DB_);
  4. ok = bdb.open();
To copy to clipboard, switch view to plain text mode 

should I bdb.open() at the begining? Won't this lock up my database?

thanks in advance
best regards
Tomasz