2017-02-25 131 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