I cant connect my Qt to Sqlite
-
ok thanks..I'll try the link..:)
-
Only remove ; .
-
[quote author="wenks21" date="1304148870"]so what should be there? :) thanks..[/quote]
Just follow secretNinja's advice and remove ; because the << operator is overloaded for "qDebug":http://doc.qt.nokia.com/latest/qdebug.html
You may also need to call text() because qDebug does not expect QSqlError:
@
qDebug() << db.lastError().text();
@ -
when i remove that line of codes. I got these errors:
error: QSqlDatabase: No such file or directory,
error: 'QSqlError' does not name a type,
error: 'QSqlDatabase' does not name a type,I'm very sorry for being newbie.. :)
-
[quote author="wenks21" date="1304150060"]when i remove that line of codes. I got these errors:
error: QSqlDatabase: No such file or directory,
error: 'QSqlError' does not name a type,
error: 'QSqlDatabase' does not name a type,I'm very sorry for being newbie.. :)
[/quote]
Make sure you have included all required headers and include the "QtSql Module ":http://doc.qt.nokia.com/latest/qtsql.html at your pro file:
@QT += sql@
If you are a newbie it is better to stick to some examples and tutorials :)
Regards,
Leon -
wow thank you very much! Now it's working.. :)
-
I still have a question. Why is that when I re-run the program the console says that 'Cannot retrieve debugging output!'
-
[quote author="wenks21" date="1304151460"]I still have a question. Why is that when I re-run the program the console says that 'Cannot retrieve debugging output!' [/quote]
Please check this thread from Qt Center: "Cannot retrieve debugging output!":http://www.qtcentre.org/threads/37438-Cannot-retrieve-debugging-output!
Please do not use a single thread for multiple question from different issues because after that it will be difficult to track down the main issue.
Best regards,
Leon -
ok i'm sorry.. thanks again it helps a lot..:)
-
This helps me a lot. :)
[quote author="leon.anavi" date="1304149339"][quote author="wenks21" date="1304148870"]so what should be there? :) thanks..[/quote]Just follow secretNinja's advice and remove ; because the << operator is overloaded for "qDebug":http://doc.qt.nokia.com/latest/qdebug.html
You may also need to call text() because qDebug does not expect QSqlError:
@
qDebug() << db.lastError().text();
@[/quote]
-
it's solved wenks21 ?