Keep getting Protocol “” is unknown error in Qt

微笑、不失礼 提交于 2020-01-16 14:06:47

问题


QUrl downloadUrl = QUrl::fromEncoded(downloadUrlStr.toAscii());

qDebug() << downloadUrl.toString();

QNetworkRequest req(downloadUrl);
req.setAttribute(QNetworkRequest::User, id);
QNetworkReply *finalReply = nam->get(req);
connect(finalReply, SIGNAL(finished()),
this, SLOT(dataFetchFinished()));

I have the above code in my Qt 4.8.4 application, but in the dataFetchFinished() slot I keep detecting the error: Protocol "" is unknown

The debug output is: "http://192.168.1.1/servlet/com.roving.report.view.excel.ExcelReportServlet?file=661&columns=0&srcType=defineBean&width=0&height=0&reportParamsId=100583&cachedId=662&t_i_m_e=1376086878417&pageStyle=0"

Any help is much appreciated!

来源:https://stackoverflow.com/questions/18156713/keep-getting-protocol-is-unknown-error-in-qt

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!