import QtQuick import QtQuick.Layouts import QtQuick.Controls import FluentUI.Controls import FluentUI.impl import QtWebEngine import QtWebChannel Item { id: control signal asyncMapInfo(var item) anchors.fill: parent QtObject { id: qtObject WebChannel.id: "channelqtObject" signal signaltest(var test) function sendToQML(data) { control.asyncMapInfo(data) } } WebChannel { id: myChannel registeredObjects: [qtObject] } ColumnLayout{ spacing: 10 anchors.topMargin: 10 anchors.bottomMargin: 10 anchors.rightMargin: 10 anchors.leftMargin: 10 anchors.fill: parent implicitHeight: parent.height // Button{ // text:"Standard Button" // Layout.fillHeight: false // onClicked: { // console.log("click") // webQues.runJavaScript("js_getBodyHeight()",null) // } // } WebEngineView { Layout.fillHeight: true Layout.fillWidth: true Layout.alignment: Qt.AlignBottom Layout.preferredWidth: 500 Layout.preferredHeight: 60230 id: webQues url: "http://localhost:8077/maptool/" // http://123.6.102.119:86/ settings.localContentCanAccessRemoteUrls: true settings.localContentCanAccessFileUrls: false settings.pluginsEnabled: false settings.fullScreenSupportEnabled: true settings.screenCaptureEnabled: false webChannel: myChannel } } function run_js(method, params={}) { var ms = method + '(' + JSON.stringify(params) + ')' console.log("run......" + ms) webQues.runJavaScript(ms) } }