you must use QThread. see documentation
http://doc.qt.nokia.com/latest/qthread.html