1. 程式人生 > >QWebView載入網頁成功但不顯示或圖示顯示不全

QWebView載入網頁成功但不顯示或圖示顯示不全

1.用QWebView::load(QUrl())載入網址的時候會提示

qt.network.ssl: QSslSocket: cannot resolve SSLv2_client_method

qt.network.ssl: QSslSocket: cannot resolve SSLv2_server_method

但是貌似又不影響使用。

2.載入淘寶或有些網址的時候圖示顯示不全或不顯示,但是又顯示載入成功(loadfinished()訊號返回true)。加上以下即可

QWebSettings *webSettings = QWebSettings::globalSettings();
    webSettings->setAttribute(QWebSettings::LocalStorageEnabled, true);

Specifies whether support for the HTML 5 local storage feature is enabled or not. This is disabled by default. (This value was introduced in 4.6.)