HI
I am using QT4.01 on windows.
Our application has to fetch data from files and push into database.
I have written a class subclassing QThread, it feteches and pushes into database.
In GUI i am providing option to select multiple files.
For single file it is working fine.Code:
for(nIndex =0 ; nIndex <strBinFileList.count(); ++nIndex) { MyThread *ptr1 = new MyThread(); connect(ptr1, SIGNAL(finished()), ptr1, SLOT(deleteLater())); ptr1->setName(strBinFileList[nIndex].toStdString().c_str()); ptr1->start(); }
When i am selecting two files it is crashing.
i have tried with only two files with out using for loop.
Code:
MyThread *ptr1 = new MyThread(); connect(ptr1, SIGNAL(finished()), ptr1, SLOT(deleteLater())); ptr1->setName(strBinFileList[0].toStdString().c_str()); ptr1->start(); MyThread *ptr1 = new MyThread(); connect(ptr1, SIGNAL(finished()), ptr1, SLOT(deleteLater())); ptr1->setName(strBinFileList[1].toStdString().c_str()); ptr1->start();
Even then also it is crashing.
In backend two databases are created around 30% of data is inserted in to db.
Each files executes independent of other. There is no dependency on input files and output databases.
Thanks in Advance....