Changed Thread to QThread