title: QSqlQueryModel complains that my database is not open
body: <p>I am trying to use <code>QSqlQueryModel</code> in order to retrieve some values from my database like such:</p>
  
  <pre><code> QSqlDatabase db = QSqlDatabase::addDatabase("QPSQL", "test1");
   db.setHostName(Vars::strDbHost);
   db.setDatabaseName(Vars::strDbName);
   db.setPort(Vars::strDbPort);
   db.setUserName(Vars::strDbUsername);
   db.setPassword(Vars::strDbPassword);
  
   db.open()
  
   QSqlQueryModel model;
   model.setQuery(QString("SELECT * FROM users WHERE login=%2").arg(Vars::strUserLogin));
  </code></pre>
  
  <p>But I keep getting a <code>QSqlQuery::exec: database not open</code> error.</p>
  
  <p>Why is this, and how can I correctly use <code>QSqlQueryModel</code> to retrieve the values I want?</p>