aboutsummaryrefslogtreecommitdiffstats
path: root/doc/codesnippets/doc/src/snippets/code/src_corelib_concurrent_qthreadpool.cpp
blob: ecbfe239b4a75f308dfc8ed31c1bfdef8448ac3b (plain)
1
2
3
4
5
6
7
8
9
//! [0]
class HelloWorldTask(QRunnable):
    def run(self):
        print "Hello world from thread", QThread.currentThread()

hello = HelloWorldTask()
# QThreadPool takes ownership and deletes 'hello' automatically
QThreadPool.globalInstance().start(hello)
//! [0]