Why this code is not working?
Qt Code:
  1. db = QSqlDatabase::addDatabase("QSQLITE"); //I defined the "db" at header.
  2. db.setDatabaseName("../database");
  3. db.open();
  4. QSqlQuery query(db);
  5. query.exec("SELECT id FROM lesson");
  6. QMessageBox::about(0,"",query.value(0).toString());
To copy to clipboard, switch view to plain text mode 

code is running without any error but value which in message box is null. There is no result at query value.