Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void FirstWindow::on_pushButton_clicked()
- {
- FirstWindow conn;
- QString rowid,Activity,thehours;
- Activity=ui->lineEdit->text();
- rowid=3;
- thehours=1;
- conn.connOpen();
- QSqlQuery qry;
- qry.prepare("insert into datatable (row,activity,hours) values('"+rowid+"','"+Activity+"','"+thehours+"')");
- //if this is good
- if(qry.exec())
- {
- this->hide();//hiding current ui
- mainwindow = new MainWindow(this);
- mainwindow->show();
- conn.connClose(); //close after inserting another
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement