Quote Originally Posted by RobbieClarken View Post
You're right that I did forget that line. Unfortunately inserting it doesn't resolve my problem.
that's not an error, because you use QSqlDatabase::database and this method automatically opens database, from docs.
QSqlDatabase QSqlDatabase::database ( const QString & connectionName = QLatin1String( defaultConnection ), bool open = true ) [static]