vittorio
15th November 2016, 22:16
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:
QSqlQueryModel DBManager::loadConnectionData()
{
QSqlQuery *qry = new QSqlQuery(dbSQLite);
QSqlQueryModel model;
qry->prepare("select * from tbl_connections");
qry->exec();
model.setQuery(*qry);
return model;
}
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
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:
QSqlQueryModel DBManager::loadConnectionData()
{
QSqlQuery *qry = new QSqlQuery(dbSQLite);
QSqlQueryModel model;
qry->prepare("select * from tbl_connections");
qry->exec();
model.setQuery(*qry);
return model;
}
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