Try to look after query.exec() what happened :
Qt Code:
  1. qDebug() << QSqlDatabase::database().lastError() << endl << query.executedQuery() << endl << query.lastError();
To copy to clipboard, switch view to plain text mode