You are not logged in.
"model.QSqlQueryModel::setQuery(.)"
THis works. But what does it really means? At the moment I'm totally confused with all this story...
Offline
When you say you get the "same error" with my suggested revision, does that mean the function returned false indicating an error - or just that the same error text was found in the error class.
Thanks again for your help. If I understand you correctly: the if statement is evaluated to yes and I get the error (tablen not found).
Also what about the documentation note I quoted? It sounds like rowCount is supposed to return zero if all is well under the conditions in which you used it. As that was initially the only indication of a problem, I fail to see what issue is being chased down here. It may seem silly for rowCount to return zero, but that is the documented behavior (unless I'm misreading it).
I have to admit, this is very illogical for me... Anycase: til saturday instantiating QSqlTableModels got the data from the tables and my QTableViews got populated...
Offline
It means that the database model basically "works" - the explicit call to the base class function sidesteps the protection in the leaf class.
What's
qDebug() << model.tables();
(regardless of setTable/setQuery)?
Offline
It means that the database model basically "works" - the explicit call to the base class function sidesteps the protection in the leaf class.
What's
qDebug() << model.tables();
(regardless of setTable/setQuery)?
I suppose you mean:
qDebug() << db.tables();
I get a list of my tables in the db... Really confusing...
Offline
Yes, sorry. What does it look like, and what happens if you use eg. "setTable(db.tables().at(0))" instead of the hardcoded string?
Offline
Yes, sorry. What does it look like, and what happens if you use eg. "setTable(db.tables().at(0))" instead of the hardcoded string?
Same error: unable to find table places and 0 rows returned...
Offline
As I imagine, it was a problem with the qt5-base update. The update to qt5-base 5.9.3(-1) of today (25th nov) solves the problem.
Offline