QWebView, how to access https protocol WebPage?

a 夏天 提交于 2021-01-28 05:49:00

问题


My platform: win32, QtSDK 2.4.1, MingW32, qt 4.7. I want to access Https protocol webpage by QWebView, how can i do that, i had download the openssl binary, and setup it, but QWebView doesn't work also, what is wrong? i needed to compile Qt source code and configure -openssl?

#include<QApplication>
#include<QtWebKit/QWebView>
#include<QUrl>

int main(int argc, char* argv[])
{
    QApplication app(argc, argv);

    QWebView view;
    view.setUrl(QUrl("https://webim.feixin.10086.cn/"));
    view.show();

    return app.exec();
}

回答1:


If Qt has been built without reference to openssl it won't be able to access any https sites, it depends on how Qt was installed on your machine initially.

You can check ssl support with: QSslSocket::supportsSsl in your program, chances are it'll have built without it. Make sure the Qt configure process is aware of where the ssl libraries are and rebuild it from there.



来源:https://stackoverflow.com/questions/11895522/qwebview-how-to-access-https-protocol-webpage

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