You are not logged in.

#26 2017-11-20 18:20:20

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: [Solved] Qt: strange behaviour after last qt5-base update

seth wrote:

"model.QSqlQueryModel::setQuery(.)"

THis works. But what does it really means? At the moment I'm totally confused with all this story...

Offline

#27 2017-11-20 18:23:48

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: [Solved] Qt: strange behaviour after last qt5-base update

Trilby wrote:

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

#28 2017-11-20 20:25:09

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [Solved] Qt: strange behaviour after last qt5-base update

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

#29 2017-11-20 21:33:50

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: [Solved] Qt: strange behaviour after last qt5-base update

seth wrote:

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

#30 2017-11-20 21:38:36

seth
Member
Registered: 2012-09-03
Posts: 49,981

Re: [Solved] Qt: strange behaviour after last qt5-base update

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

#31 2017-11-21 08:19:55

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: [Solved] Qt: strange behaviour after last qt5-base update

seth wrote:

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

#32 2017-11-25 14:44:37

rogorido
Member
Registered: 2009-08-17
Posts: 111

Re: [Solved] Qt: strange behaviour after last qt5-base update

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

Board footer

Powered by FluxBB