PDA

View Full Version : interface GUI die when run some " while() do "



azerty_fr
14th June 2007, 09:12
Hi

I made some functions in which I used some " while () { .. }".

When the programe started, the GUI died , howerver the others applications worked well ( a bit slow but worked ).

I know I have to use moveToThread, I wrote some functions but they didn't work

Have you got any idea? Thanx a lot


Class QThreadEX:public QThread
{
Q_OBJECT
....
protected:
void run(){ exec();}
}
File ui:

void test_thread:: on_pushButton_clicked(){
QThreadEx * confThread = new QThreadEx()
config conf;

confThread->start;
conf.moveToThread(confThread);



connect(confThread, SIGNAL(started()),conf, SLOT(conf.test());

}

wysota
14th June 2007, 10:35
The slot connection is incorrect. Should be "SLOT(test())" and not "SLOT(conf.test())". Furthermore you create "conf" on the stack, so it is destroyed once the function returns.

azerty_fr
14th June 2007, 15:39
I've already completed it with success :D. Thanx anyway