问题
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