Monday, January 3, 2011

Sqlite in Qt

To connect to the Sqlite database in Qt
  1. add "#include "
  2. add "QSqlDatabase db=QSqlDatabase::addDatabase("QSQLITE")" in the code body
  3. enter "qmake -project"
  4. add "QT += sql" in the xxx.pro file
  5. enter "qmake"
  6. enter "make"

1 comment: