QtLocation地图与代理

时间:2018-07-30 11:49:32

标签: qt proxy proxy-authentication qtlocation

所以我想知道为什么我不能在代理服务器上使用QtLocation映射。 我正在使用Power Mockito dependencies - All Jars中的示例。

当我编译并运行它时,它不显示任何地图,并且一段时间后程序会记录:

QGeoTileRequestManager: Failed to fetch tile (277436,168340,19) 5 times, giving up. Last error message was: 'Host otile1.mqcdn.com konnte nicht gefunden werden'

这意味着他找不到主机。

当我添加时:

QNetworkProxyFactory::setUseSystemConfiguration(true);

日志更改为“ Proxy-Authentifizierung erforderlich”,表示他需要进行身份验证。

现在我尝试添加QNetworkAccessManager并将插槽连接到proxyAuthenticationRequired()信号。但是,这不起作用。即使我可以发送似乎正常的QNetworkRequst,我仍然会遇到相同的错误。

以下是广告位的代码:

if(!connect(&manager,SIGNAL(proxyAuthenticationRequired(QNetworkProxy,QAuthenticator*)),this,SLOT(authProxy(QNetworkProxy,QAuthenticator*))))
    qDebug("Failed to connect");



void MainClass::authProxy(const QNetworkProxy &proxy, QAuthenticator *authenticator){
    qDebug("Slot evoked");
    authenticator->setUser("user");
    authenticator->setPassword("password");
}

那么我如何向代理服务器进行身份验证?

P.S .:我使用的是Qt 5.5.1版

0 个答案:

没有答案