Logo Search packages:      
Sourcecode: qt4-x11 version File versions  Download package

src_corelib_concurrent_qthreadpool.cpp

//! [0]
00002 class HelloWorldTask : public QRunnable
{
00004     void run()
    {
        qDebug() << "Hello world from thread" << QThread::currentThread();
    }
}

HelloWorldTask *hello = new HelloWorldTask();
// QThreadPool takes ownership and deletes 'hello' automatically
QThreadPool::globalInstance()->start(hello);
//! [0]

Generated by  Doxygen 1.6.0   Back to index