I think most of the QtSql examples I've seen simply access database connection via the static method QSqlDatabase::database() whenever needed, without the need of storing connection as member variable anywhere. QSqlDatabase::database() seems to be basically a call to QHash::value() in a thread-safe manner so it's not that inefficient at least. :)