The home listing widget of e.g. QtHelp and man documentation plugins is
done with a QTreeView, handling the QTreeView::clicked signal by
synchronously providing a new StandardDocumentationView instance
to the viewer. The viewer then drops the current widget
(thus the QTreeView), but with a deleterLater(), so e.g. the still
on-going mousereleaseevent handler will not get into trouble.
That good intention though is screwed over during setting up the
new documentation page, still in sync processing, when setting
a new custom QWebEnginePage:
that results in destruction of the default one, which deep down
in the destruction process inside ~QQuickRenderControl() results
in some nested event loop. Which then also results in deletion
of our QTreeView instance already. So when execution finally
returns to the mousereleaseevent handler to continue... -> boom
Patch fixes this by setting the custom QWebEnginePage on setup,
so no default instance is created (happens on first access to
page()) and thus also no destructor is called.
The delegation policy is controlled by keeping a pointer to the
custom page and flipping the delegation flag as needed.