[qt] only access window id when the window is created