Fix ambigous parent()

The parent() could be either QPlatformWindow::parent()
or QObject::parent().