Qt thread error to be fixed