QML开发简单浏览器(加载H5)

QML开发浏览器以及加载HTML5页面,主要利用QML的WebEngineView可实现对网页的加载。

其代码如下:

import QtQuick 2.4
import QtQuick.Layouts 1.2
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtWebEngine 1.1

Rectangle {
    id: root

    width: 800
    height: 600

    Rectangle {
        id: edit_area
        width: parent.width
        height: 70
        anchors {
            left: parent.left
            right: parent.right
        }
        color: "#E4EEF9"

        Button {
            id: goBack_click
            anchors {
                left: parent.left
                leftMargin: 5
                verticalCenter: edit_area.verticalCenter
            }
            width: 30
            height: url_edit.height
            property color bgColor: webView.canGoBack?"blue":"gray"
            style: ButtonStyle {
                background: Rectangle {
                    anchors.fill: parent
                    
  • 1
    点赞
  • 9
    收藏
    觉得还不错? 一键收藏
  • 1
    评论
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值