2016-04-09 131 views
0

在我的Qt項目中,我有一個初始化的QWebView,我創建它,加載一個url,然後顯示它。過去曾經工作過,但現在它已停止加載。QWebview not loading

相關代碼:

void MainWindow::activateWebView() 
{ 
    webview = new QWebView(); 
    QUrl link("https://accounts.google.com/o/oauth2/auth?client_id=724514964748-43gb17l2laj7mg3vcj2qpfe7o6fn4ceu.apps.googleusercontent.com&redirect_uri=urn:ietf:wg:oauth:2.0:oob&scope=https://www.googleapis.com/auth/youtube&response_type=code&access_type=offline"); 
    connect(webview, SIGNAL(loadFinished(bool)), this, SLOT(webViewloadFinished(bool))); 
    webview->setWindowTitle("Connecting to Google..."); 
    connect(webview, SIGNAL(titleChanged(QString)), webview, SLOT(setWindowTitle(QString))); 

    webview->setMinimumSize(600, 700); 
    webview->setMaximumSize(600, 700); 
    webview->setWindowModality(Qt::WindowModal); 
    webview->show(); 
    webview->load(link); 
} 
+0

什麼是您的Qt版本? – IAmInPLS

+0

@AlexisP。目前,我正在使用Qt版本5.5 –

+0

您可能希望嘗試'QWebEngineView'而不是'QWebView',因爲Qt WebKit已棄用。此外,你可以閱讀更多關於它[這裏](https://doc-snapshots.qt.io/qt5-5.6/qtwebenginewidgets-qtwebkitportingguide.html) – IAmInPLS

回答

0

我想通了。從最後的成功構建到最新的不成功構建,我重新安裝了我的操作系統。這顯然造成了一些SSL dll的問題。我錯過了三個文件在我的MinGW

  • libssl32.dll
  • ibeay32.dll
  • ssleay32.dll

我發現這些文件在安裝OpenSSL。我將這些文件添加到我的MinGW bin文件夾中,現在它正在運行!