Force WebEnginePart to follow the global KDE proxy settings.
QtWebEngine uses the proxy set with QNetworkProxy::setApplicationProxy, which
means that it ignores the KDE proxy settings chosen by the user.
To force QtWebEngine to respect the user's preferences, read the proxy settings
using KProtocolManager and call QNetworkProxy::setApplicationProxy
appropriately. QtWebEngine only supports a global proxy settings, so you can't
have different proxies for different URLs or different proxies for HTTP and
HTTPS URLs (except, perhaps, by calling QNetworkProxy::setApplicationProxy for
every call to Qt::WebEngine::acceptNavigationRequest). Because of this
limitation, the following approach is used:
- call KProtocolManager::proxyForUrl twice: once with a fake HTTP URL and once with a fake HTTPS protocol
- if the two proxies are different, ask which one should be used.