What exactly "doesn't work"?
@wysota
it simply doesn't open up any databases, when requested to do so
@at the other guys
will try qdebug and then post another reply with the results
well I did play with qDebug for a while it tells me that well, here are the results:
we are in openfile() now
database opened
path not empty
one thing I added qDebug() << "database opened"
as part of that if that tests if the database is opened (in loaddatabase() ),
so aparently the problem doesn't lie in the path String.
Any ideas where it might lie?
If you need any code I will show it upon request
Thanks in advance
Did you try asking the database what the problem was?
QSqlDatabase::lastError()
Nefastious (27th September 2009)
By using
Qt Code:
qDebug() << db.lastError();To copy to clipboard, switch view to plain text mode
I get the following:
QSqlError(-1, "", "")
What does this mean?
It means there is no error in the database object. How do you know the database failed to open?
Nefastious (29th September 2009)
Well,
there is a model connected to the database and then a TableView connected to the model, and the View remains blank after I supposedly load the database...![]()
Any ideas?
It doesn't mean the database failed to open!
What do QSqlDatabase::open() and QSqlDatabase::isOpen() return?
Nefastious (29th September 2009)
true on both
so we can assume that the problem doesn't lie on the database object itself, but where could it lie? Any ideas?
The query is probably incorrect or the table is empty. Check the last error of the model.
Nefastious (29th September 2009)
Bookmarks