qml加载网页

import QtQuick 2.5
import QtQuick.Window 2.2
import QtWebEngine 1.1

Item {
    visible: true
    width: 640
    height: 480

    WebEngineView {
        id: onlineMap
        visible: true
        width: 1366
        height: 768-46
        settings.javascriptEnabled : true
        settings.pluginsEnabled:true
        anchors.fill: parent
        url: "qrc:/test.html"

        Component.onCompleted: {
            console.debug(url)
        }
        MouseArea{
            id: mouseArea
            anchors.fill: onlineMap;
            acceptedButtons: Qt.LeftButton | Qt.RightButton
        }
    }
}
 

猜你喜欢

转载自blog.csdn.net/qq_27081181/article/details/85105281