abenchaaben
30th January 2017, 16:47
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.
void MainFrame::OnProcessStain()
{
QSqlQuery qry;
qry.prepare("INSERT INTO project (user, ) " "VALUES (?)");
qry.addBindValue(username);
qry.exec();
QMessageBox msg1(QMessageBox::Information,"About","Thank you!!!",QMessageBox::Ok);
msg1.setFixedSize(720,720);
QPixmap image1 = QPixmap("zicon1.png");
msg1.setIconPixmap(image1);
msg1.show();
msg1.exec();
QCoreApplication::exit();
}*
Any Help Please.
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.
void MainFrame::OnProcessStain()
{
QSqlQuery qry;
qry.prepare("INSERT INTO project (user, ) " "VALUES (?)");
qry.addBindValue(username);
qry.exec();
QMessageBox msg1(QMessageBox::Information,"About","Thank you!!!",QMessageBox::Ok);
msg1.setFixedSize(720,720);
QPixmap image1 = QPixmap("zicon1.png");
msg1.setIconPixmap(image1);
msg1.show();
msg1.exec();
QCoreApplication::exit();
}*
Any Help Please.