Hi all,
I try to write a function, which generates a QSqlQueryModel and returns this model to the calling function. First I thought, this should be an easy thing but obviously I was wrong!
I searched the forum but found no information, which could help me...

My function:
Qt Code:
  1. QSqlQueryModel DBManager::loadConnectionData()
  2. {
  3. QSqlQuery *qry = new QSqlQuery(dbSQLite);
  4. qry->prepare("select * from tbl_connections");
  5. qry->exec();
  6. model.setQuery(*qry);
  7. return model;
  8. }
To copy to clipboard, switch view to plain text mode 

When I try to compile the code I get following error message:
Fehler: C2280: 'QSqlQueryModel::QSqlQueryModel(const QSqlQueryModel &)': attempting to reference a deleted function

I didn't find an explanation on the net which helped me to understand the problem, so maybe someone here is so kind to help me a little bit?

Thanks in advance!!

Viktor