我的操作系统是win10,QT版本是Qt5.7 mingw53_32,目标操作系统是win10。当我使用qmlscene
执行qml文件时,发生了一些错误:
qrc:/[...].qml:3 模块“QtWebView”未安装
我的 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
}
}
}
}
And I had installed some modules.
QtWebView
是一个模块,它为限制性平台(例如 iOS)提供围绕特定于平台的 Web 视图的包装器组件,这些平台不允许应用程序提供自己的 HTML 内容呈现器。
在功能齐全的平台(例如桌面 Windows)上,您可以使用功能更强大的 Web 渲染器集成,例如提供的一个QtWebEngine
module http://doc.qt.io/qt-5/qml-qtwebengine-webengineview.html或由QtWebKit
module https://trac.webkit.org/wiki/QtWebKit
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)