[qt] fix crash and some problem on restart