gui: Use QThread properly