2017-02-25 123 views
1

我的操作系統是win10,QT的版本是Qt5.7 mingw53_32,目標操作系統是win10。當我使用qmlscene到EXCUTE一個QML文件,它出現了錯誤:QT:未安裝模塊「QtWebView」

qrc:/[...].qml:3 module "QtWebView" is not installed

我的QML文件以下。

import QtQuick 2.0 
import QtQuick.Controls 1.0 
import QtWebView 1.1 

ScrollView { 
    width: 1280 
    height: 720 
    WebView { 
     id: webview 
     url: "http://www.baidu.com" 
     anchors.fill: parent 
     onNavigationRequested: { 
      // detect URL scheme prefix, most likely an external link 
      var schemaRE = /^\w+:/; 
      if (schemaRE.test(request.url)) { 
       request.action = WebView.AcceptRequest; 
      } else { 
       request.action = WebView.IgnoreRequest; 
       // delegate request.url here 
      } 
     } 
    } 
} 

而且我安裝了一些模塊。 enter image description here

+1

可能的複製提供了一個[如何安裝缺少的Qt模塊?](http://stackoverflow.com/questions/40200094/how-to-install-a-missing -qt-module) – Mike

+0

你的目標平臺是什麼? – MrEricSir

+0

@MrEricSir:「我的操作系統是win10,QT的版本是Qt5.7 mingw53_32。」[引用:帖子的第一行]。由於沒有提到交叉編譯,我認爲可以肯定這是目標平臺嗎? – derM

回答

2

QtWebView是提供各地的受限制的平臺如iOS版這絕對不允許應用程序提供自己的HTML內容的渲染平臺特定的Web視圖包裝部件的模塊。

在諸如桌面Windows之類的功能齊全的平臺上,您可以使用功能更強大的Web呈現器集成,由QtWebEnginemodule或通過的QtWebKitmodule