I transfer the MainWindow's pointer to a thread,and in the thread I call send event to this
window.In fact, after a while sendEvent don't return.I know in thread had better not call any GUI funtion, and i know sendEvent only return after the message is processed too.
Thanks a lot!