<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def createThread(parent, worker, deleteWorkerLater=False):
 """Create a new thread for given worker. Args: parent (QObject):
 parent of thread and worker. worker (ProgressWorker):
 worker to use in thread. deleteWorkerLater (bool, optional):
 delete the worker if thread finishes. Returns: QThread """

    thread = QtCore.QThread(parent)
    thread.started.connect(worker.doWork)
    worker.finished.connect(thread.quit)
    if deleteWorkerLater:
        thread.finished.connect(worker.deleteLater)

    worker.moveToThread(thread)
    worker.setParent(parent)
    return thread