我有一个本地 html 文件,它使用 highcharts 显示我的数据并保存到图像,它在 chrome 浏览器中运行良好,然后我尝试使用 WebEngineView(QML 类型)在 Qt 5.9.4 中加载它,所有弹出对话框都无法显示。
html文件代码:https ://jsfiddle.net/sylance/9x9j5Lpj/
<div id="container" style="width: 100%; min-height: 400px"></div>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/offline-exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>
<script type="text/javascript">
Highcharts.setOptions({
navigation: {
menuItemStyle: {
padding: '6px 14px'
}
}
});
var chart = new Highcharts.Chart({
chart: {
renderTo: 'container'
},
exporting: {
filename: 'data'
},
title: {
text: 'export file'
},
xAxis: {
categories: ['1', '2', '3', '4', '5', '6', '7', '8', '9', '10', '11', '12']
},
series: [{
name: 'test data',
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4]
}]
});
</script>
qml 文件:
Page {
WebEngineView {
id: webView
anchors.fill: parent
url: "qrc:/html/index.html"
}
}
如何使 WebEngineView 显示对话框,例如文件对话框、打印对话框等。