Unsolved iconUrlChanged signal not received with custom url scheme
-
I’am using a custom scheme for a RSS reader
The generated html includes a favicon:<link rel="icon" href="favicon.png" sizes="16x16" type="image/png">
In Qt 5.6, I receive the iconUrlChanged able me to set the appropriate icon in the url field of the toolbar
In Qt 5.7.1, it doesn’t work anymore, neither iconUrlChanged nor iconChanged are received.Putting some logs shows that the request is correct in the schemeHandler:
RSS requestStarted: QUrl("rss:/favicon.png") icon QUrl("rss:/favicon.png") data RSS "image/png" 3806 bytes
I expect thereafter to receive the icon in my iconChanged slot, but nothing happens.
On the other hand, i’m questioning myself about the new AutoLoadIconsForPage setting in Qt 5.7
Since Qt 5.5, i’m implementing my own favicon management (loading/caching …), therefore , enable the AutoLoadIconsForPage setting seems unnecessary as it will doing the same job double time.
But if i disable this option, again i don’t receive the iconUrlChanged, so no icon is loaded at all.Is this the correct behavior ?
and if so what i’m doing wrong ?Thanks in advance
-
I think you can solve your problem by overriding this function:
http://doc.qt.io/qt-5/qwebenginepage.html#acceptNavigationRequest
You have to check the url scheme that match your custom url sheme then do emit iconUrlChanged signal, other cases, call to this parent method to execute th request.