Browse Source

fix QWebEngineView's navigation request issue in Qt 5.12

Le Tan 6 years ago
parent
commit
bda9bf51c1
1 changed files with 3 additions and 0 deletions
  1. 3 0
      src/vpreviewpage.cpp

+ 3 - 0
src/vpreviewpage.cpp

@@ -24,6 +24,9 @@ bool VPreviewPage::acceptNavigationRequest(const QUrl &p_url,
         }
     } else if (!p_isMainFrame) {
         return true;
+    } else if (p_url.scheme() == "data") {
+        // Qt 5.12 will trigger this when calling QWebEngineView.setHtml().
+        return true;
     }
 
     QDesktopServices::openUrl(p_url);