[Interest] Emitting signal from QThread::run()

Thiago Macieira thiago.macieira at intel.com
Sat Feb 27 07:49:22 CET 2016


On sábado, 27 de fevereiro de 2016 11:45:50 PST Syam wrote:
> void MainWindow::someFunction()
> {
>    MyThread *thread = new MyThread;
>    connect(thread, SIGNAL(mySignal()), this, SLOT(myGuiSlot()),
> Qt::QueuedConnection);
>    thread->start();
> }
> 
> 
> //////////////////
> 
> Will the above code work fine? In myGuiSlot() I am typically manipulating
> some widgets - setting the text of a QLabel etc.

Yes. The signal will be queued anyway.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Software Architect - Intel Open Source Technology Center




More information about the Interest mailing list