extern "C" void printmessage( char* msg ){ mythread->ConsoleMessage( mythread::tr(msg) );}
void MyThread::ConsoleMessage( QString message ){ emit sigConsoleMessage( message );}
connect( mythread, SIGNAL(sigConsoleMessage(QString)), pMainWindow, SLOT(slMessage(QString)), Qt::BlockingQueuedConnection);
while( MyThread->isRunning() ) qDebug() << "running";