sgtbash
3rd May 2009, 14:20
Hi guys, i have a problem. I've a QWizard which have a some instruction which take a little bit time, so i decided to create a thread just to do these operations. At the end of this thread i have a new QObject created by this QThread, and i want to pass it to the QMainWindow, the point is that this new QObject is child of QThread and i get this :
QObject: Cannot create children for a parent that is in a different thread.
I tried to move the Object like in the example of the documentation
myObject->moveToThread(QApplication::instance()->thread());
But nothings happens, i also tried to force with the setParent() method but none of these worked.
How can i fix it?
QObject: Cannot create children for a parent that is in a different thread.
I tried to move the Object like in the example of the documentation
myObject->moveToThread(QApplication::instance()->thread());
But nothings happens, i also tried to force with the setParent() method but none of these worked.
How can i fix it?