Hi,

I'm working on a project and i'm using Qsql for the first time. I'm trying to insert a data into my database. The problem is that the Click Method that i use to do the insert, i have a messagebox that inform the user that the process is done. With that evry time i click process, i have a double insert into the database. But when i comment the messageBox code, evry thing go well.

Qt Code:
  1. void MainFrame::OnProcessStain()
  2. {
  3. qry.prepare("INSERT INTO project (user, ) " "VALUES (?)");
  4. qry.addBindValue(username);
  5. qry.exec();
  6.  
  7. QMessageBox msg1(QMessageBox::Information,"About","Thank you!!!",QMessageBox::Ok);
  8. msg1.setFixedSize(720,720);
  9. QPixmap image1 = QPixmap("zicon1.png");
  10. msg1.setIconPixmap(image1);
  11. msg1.show();
  12. msg1.exec();
  13. }*
To copy to clipboard, switch view to plain text mode 

Any Help Please.