1 Attachment(s)
Problem while inserting the data into database
Hi,
I am using Qt4.4 and SQLITE for database. I got a problem while inserting the data into database.While inserting continuously if I open any dialog then the entire application is breaking . I have attached my application in which it contains two buttons, one is for inserting the data continuously and another one is to open a dialog .If I click once insert button, data will keep on inserting into database ,at that time if I click on another button to open a dialog then the application breaks.
So help me to solve this problem
With Regards,
Sudheer
Re: Problem while inserting the data into database
It looks like your application halts because you are showing a modal dialog. Try this instead:
Code:
void datapro::on_pushButton_2_clicked()
{
dig dialod(this);
dialod.show();
}
Re: Problem while inserting the data into database
The crash is due to the fact that for some (bad) reason you insert the adress of a local (stack!) variable into your QVector (the one in your class). That adress is invalid, when inst() is left. When you access that again, you are like to crash.
Replace that (I seem to remember having suggested that to you in another thread) by QList<QStringList> and you are safe.
HTH