[Qt-interest] Basic QThread question

Mandeep Sandhu mandeepsandhu.chd at gmail.com
Tue Apr 27 09:46:57 CEST 2010


>
> Then in your main thread somewhere have something like this:
>
> DevicePoller* m_workerThread = new DevicePoller( this );

You meant PollingThread here, I think! :)
>
> // Will use a Qt::QueuedConnection as objects live in different threads
> connect( m_workerThread->poller(), SIGNAL( value( int ) ),
>         this, SLOT( processValue( int ) ) );
>
> m_workerThread->start();
>
> You should now get signals with the polled values delivered to your object in
> the main thread once a second without blocking anything.
>
> HTH,
>
> Sean
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>




More information about the Qt-interest-old mailing list