Don't include unistd.h and use QThread::sleep() instead of sleep(). Maybe this will help.