Hello,

Inspired from the recent discussions on QThread, I have the following
question.
I have:

class MyThread : public QThread
{
   Q_OBJECT
    //the constructor and other stuff

signals:
     void mySignal();

protected:
  virtual void run()
  {
     while(true)
     {
        //do something
        if(some_condition) emit mySignal();
     }
  }
};


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.



-- 
Regards,

Syam
sya...@gmail.com
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to