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