Hi, I am very new to using QT4. I am trying to use sql in an already working application. However, when I try to compile I get this error: "‘QSqlDatabase’ was not declared in this scope."
Here is the relevent code:
#include <QtSql>
QSqlDatabase db = QSqlDatabase::addDatabase("QMYSQL");
db.setHostName("bigblue");
db.setDatabaseName("flightdb");
db.setUserName("acarlson");
db.setPassword("1uTbSbAs");
bool ok = db.open();
I have added QT += sql to my .pro file.
The code above it literally copied from here:http://qt.nokia.com/doc/4.5/qtsql.html
Any idea what I am doing wrong?