[Interest] QWebEnginePage acceptNavigationRequest leads to empty page

Allan Sandfeld Jensen kde at carewolf.com
Mon Jan 28 23:25:06 CET 2019


On Montag, 28. Januar 2019 13:11:45 CET Sven Bergner wrote:
> Hi there,
> I have an app that uses QWebEngine to show a webpage that has a link to a
> pdf document.
> Now I want to handle a click on that link by
> implementing QWebEnginePage::acceptNavigationRequest().
> The method is called an I can check if the link leads to a pdf and if so I
> handle the url by myself and return false. The downside is that the
> QWebEngineView now shows an empty page.
> Is there any way to prevent this? I want to stay on the same page where the
> link was clicked.
> Any hints?
> 
Try disabling error-pages, with error-pages disabled, errors should result in 
staying on the same page, where with them enabled, navigations always go 
somewhere.

Still sounds like an error, navigation should either not be performed or go an 
error-page.

'Allan





More information about the Interest mailing list