Don't forget to put the QT+= sql in your project file