Don't parent dialogs using WId
This causes glitches in the parent dialog, as winId causes problems when called on non-toplevel widgets, as done here.
Calling window()->winId() would also have fixed this, but using the QWidget-based parenting API seems more robust.
(cherry picked from commit 44d4427830ac64dc5d8a7f461531c0395f567e22)