c++ - Inserting a new Record -




using below code can display records in database now.

mainwindow::mainwindow(qwidget *parent) : qmainwindow(parent), ui(new ui::mainwindow) {     ui->setupui(this);     this->setcentralwidget(ui->tableview);     db = qsqldatabase::adddatabase("qmysql");     db.sethostname("localhost");     db.setdatabasename("employee");     db.setusername("root");     db.setpassword("password");      db.open();     model=new qsqltablemodel(this);     model->settable("employee_details");     model->select();     ui->tableview->setmodel(model); } 

how can insert new record?

also, can insert empty record , edit in later values?

thank you.





wiki

Comments

Popular posts from this blog

Asterisk AGI Python Script to Dialplan does not work -

python - Read npy file directly from S3 StreamingBody -

kotlin - Out-projected type in generic interface prohibits the use of metod with generic parameter -