What happens if you don't try to bind the table name? Also, QSqlQuery::bindValue() docs seems to suggest binding NULL values like this:
Qt Code:
  1. query.prepare("INSERT INTO kraj (id,ime,postna_st) VALUES (:id,:ime,:postna_st)");
  2. query.bindValue(":id",QVariant(QVariant::Int));
  3. query.bindValue(":ime",edit_ime->text());
  4. query.bindValue(":postna_st",edit_postna_st->text());
  5. query.exec();
To copy to clipboard, switch view to plain text mode