PDA

View Full Version : Problem while inserting the data into database



sudheer168
13th December 2008, 09:19
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

rexi
13th December 2008, 12:16
It looks like your application halts because you are showing a modal dialog. Try this instead:


void datapro::on_pushButton_2_clicked()
{
dig dialod(this);
dialod.show();
}

caduel
13th December 2008, 12:22
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