Reputation: 2239
I am new to Qt and C++ (coming from the PHP world) and am stuck on something that is probably pretty obvious: including non-core Qt modules.
I (understandably) get the compile error that QSqlDatabase does not name a type
.
I also get errors when I include either of the following:
#include <QSqlDatabase>
#include <QSql>
Any idea how to include the QSql module? Thanks in advance.
Upvotes: 0
Views: 900
Reputation: 6283
Add
QT += sql
To your .pro file to enable this module.
Be careful that you don't do
QT = ..
after the
QT += sql
Or simply put all the modules in one line:
QT = core gui sql
Upvotes: 2