Hello. I've tried to right an app with Qt 5.1.1 using sql. When I build my app I get the following error: "Cannot open include file: 'QSqlDatabase': No such file or directory". I've already put the line in the .pro file: QT += sql

Has anyone any ideas what can I do? Thanks in advance.

P.S.: The part of my application with sql code is quite simple:

Qt Code:
  1. QSqlDatabase db(QSqlDatabase::addDatabase("QMYSQL"));
  2.  
  3. //connect to database
  4. db.setDatabaseName("sarbatori.mwb");
  5.  
  6. if ( !db.open() )
  7. QMessageBox::critical(0, "Error", db.lastError().text());
  8. else
  9. QMessageBox::information(0, "OK", "Merge!!!");
To copy to clipboard, switch view to plain text mode