[qt] only access window id when the window is created
Merge branch 'bug-fix'