Advertisement
Guest User

Untitled

a guest
Feb 9th, 2016
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. void FirstWindow::on_pushButton_clicked()
  2. {
  3. FirstWindow conn;
  4.  
  5. QString rowid,Activity,thehours;
  6. Activity=ui->lineEdit->text();
  7. rowid=3;
  8. thehours=1;
  9.  
  10. conn.connOpen();
  11. QSqlQuery qry;
  12. qry.prepare("insert into datatable (row,activity,hours) values('"+rowid+"','"+Activity+"','"+thehours+"')");
  13.  
  14. //if this is good
  15. if(qry.exec())
  16. {
  17. this->hide();//hiding current ui
  18. mainwindow = new MainWindow(this);
  19. mainwindow->show();
  20.  
  21.  
  22. conn.connClose(); //close after inserting another
  23. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement