title: QWebEngineView not closing properly in some cases
body: <p>I found that <code>QWebEngineView</code> behaves very strange (Windows PyQt5 with Qt 5.7.0) and in some cases does not finish properly leaving the application hanging. The following snippet works fine. But if you uncomment both lines marked with <code>#1</code> and <code>#2</code> and then try to close the application, the application get hung. The same happens if you uncomment only <code>#3</code>. I tried this with other widgets than <code>QWebEngineView</code>, and no problems occurred.</p>
  
  <pre><code>import sys
  from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
  app = QtWidgets.QApplication(sys.argv)
  mainWindow = QtWidgets.QMainWindow()
  widget = QtWebEngineWidgets.QWebEngineView()
  # widget.load(QtCore.QUrl("http:/www.google.com"))  #1
  mainWindow.setCentralWidget(widget)
  # mainWindow.setCentralWidget(None)                 #2
  # widget.deleteLater()                              #3
  mainWindow.show()
  result = app.exec_()
  sys.exit(result)
  </code></pre>
  
  <p>This is the shortest code which can reproduce the error. But what I need in my much larger application is to set web engine view as the central widget and then with menu actions close it and set another widget as central widget. Any ideas how to fix the behaviour and achieve the expected behaviour? Or am I doing something wrong?</p>
  
  <p>UPDATE:</p>
  
  <p>I found even simpler example exhibiting the described issue. Running this on Windows, PyQt 5.7 leaves the application hanging.</p>
  
  <pre><code>import sys
  from PyQt5 import QtCore, QtWidgets, QtWebEngineWidgets
  app = QtWidgets.QApplication(sys.argv)
  widget = QtWebEngineWidgets.QWebEngineView()
  widget.setAttribute(QtCore.Qt.WA_DeleteOnClose)
  widget.show()
  sys.exit(app.exec_())
  </code></pre>
  
  <p>UPDATE2:
  I create a ticket for this as this seems to me as a bug. <a href="https://bugreports.qt.io/browse/QTBUG-57228" rel="nofollow noreferrer">https://bugreports.qt.io/browse/QTBUG-57228</a> However before the fix is delivered, any workaround would be very appreciated.</p>