In standard multithread connection signal and slot are connected in Qt::QueuedConnection mode. To work this it must be working event loop in thread. In your case there is no working event loop. Try change code to something like this :
void myThread::run()
{
QTimer::singleShot( 0,
this,
SLOT(doSomethingOne
()));
}
void myThread::doSomethingOne()
{
//do something
emit display("show the result"); //NOW IS WORKING :)
QTimer::singleShot( 0,
this,
SLOT(doSomethingOne
()));
}
void myThread::run()
{
QTimer::singleShot( 0,this,SLOT(doSomethingOne()));
QThread::run();
}
void myThread::doSomethingOne()
{
//do something
emit display("show the result"); //NOW IS WORKING :)
QTimer::singleShot( 0,this,SLOT(doSomethingOne()));
}
To copy to clipboard, switch view to plain text mode
Standard QThread::run method starts event loop.
Bookmarks