Calling Recursivly loading function in Run() method of QThread
hi
I m using recursivly loading directory method in Run() function of QThread.
i m giving definiton of this method in other class and displaying in treeWidget.
when i m calling this method using object of this class in Run() method it becomes crashed...
void class::Run()
{
otherclass *obj;
while(!bFalse)
{
obj->method(QString path);
}
}
here while loop is better or if else.
can u give me suggestions that why this happens..can I use Gui classes in QThread or not...
Re: Calling Recursivly loading function in Run() method of QThread
well, to start with, in the code above 'obj' is not initialized, and that alone would make it crash.
Re: Calling Recursivly loading function in Run() method of QThread
Do not modify the GUI from another thread. This must be done only by the GUI thread.
Instead of what you do, notify the GUI thread( via signals ) and let it update the widgets.