Qt+C++自建网页浏览器-Chrome blink最新内核基础上搭建-改进版本

news2024/10/6 2:30:04

 程序示例精选

Qt+C++自建网页浏览器-Chrome blink最新内核基础上搭建-改进版本

如需安装运行环境或远程调试,见文章底部个人QQ名片,由专业技术人员远程协助!

前言

这篇博客针对<<Qt+C++自建网页浏览器-Chrome blink最新内核基础上搭建-改进版本>>编写代码,代码整洁,规则,易读。 学习与应用推荐首选。


文章目录

一、所需工具软件

二、使用步骤

1. 引入库

2. 窗体界面

3. 运行结果

三、在线协助

一、所需工具软件

1. VS, Qt

2. Win10, Win11

二、使用步骤

1.引入库

代码如下(示例):


#include "QUrl"
#include <iostream>
#include<string>
#include<QKeyEvent>
#include<QFontDatabase>
#include<QWebEngineSettings>
#include<QWebEngineCookieStore>

2.窗体界面

代码如下(示例):


QT_BEGIN_NAMESPACE

class Ui_MainWindowClass
{
public:
    QAction *actionaa;
    QWidget *centralWidget;
    QGridLayout *gridLayout_3;
    QFrame *frame_2;
    QGridLayout *gridLayout_2;
    QComboBox *comboBox;
    QHBoxLayout *horizontalLayout;
    QPushButton *pushButton_4;
    QPushButton *pushButton_3;
    QPushButton *pushButton_2;
    QLineEdit *lineEdit;
    QPushButton *pushButton;
    QPushButton *pushButton_5;
    QPushButton *pushButton_6;
    QSpacerItem *horizontalSpacer;
    QSpacerItem *horizontalSpacer_2;
    QLabel *label;
    QFrame *frame;
    QGridLayout *gridLayout;
    QWebEngineView *webEngineView;
    QMenuBar *menuBar;
    QToolBar *mainToolBar;
    QStatusBar *statusBar;

    void setupUi(QMainWindow *MainWindowClass)
    {
        if (MainWindowClass->objectName().isEmpty())
            MainWindowClass->setObjectName(QString::fromUtf8("MainWindowClass"));
        MainWindowClass->resize(716, 400);
        actionaa = new QAction(MainWindowClass);
        actionaa->setObjectName(QString::fromUtf8("actionaa"));
        QIcon icon;
        QString iconThemeName = QString::fromUtf8("dfds");
        if (QIcon::hasThemeIcon(iconThemeName)) {
            icon = QIcon::fromTheme(iconThemeName);
        } else {
            icon.addFile(QString::fromUtf8(":/MainWindow/png/\346\211\223\345\274\200\346\226\207\344\273\266\345\244\271-\347\272\242\350\211\262.png"), QSize(), QIcon::Normal, QIcon::Off);
        }
        actionaa->setIcon(icon);
        centralWidget = new QWidget(MainWindowClass);
        centralWidget->setObjectName(QString::fromUtf8("centralWidget"));
        gridLayout_3 = new QGridLayout(centralWidget);
        gridLayout_3->setSpacing(6);
        gridLayout_3->setContentsMargins(11, 11, 11, 11);
        gridLayout_3->setObjectName(QString::fromUtf8("gridLayout_3"));
        frame_2 = new QFrame(centralWidget);
        frame_2->setObjectName(QString::fromUtf8("frame_2"));
        QSizePolicy sizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred);
        sizePolicy.setHorizontalStretch(1);
        sizePolicy.setVerticalStretch(0);
        sizePolicy.setHeightForWidth(frame_2->sizePolicy().hasHeightForWidth());
        frame_2->setSizePolicy(sizePolicy);
        QFont font;
        font.setFamily(QString::fromUtf8("3ds"));
        font.setPointSize(16);
        frame_2->setFont(font);
        frame_2->setFrameShape(QFrame::Box);
        frame_2->setFrameShadow(QFrame::Raised);
        gridLayout_2 = new QGridLayout(frame_2);
        gridLayout_2->setSpacing(6);
        gridLayout_2->setContentsMargins(11, 11, 11, 11);
        gridLayout_2->setObjectName(QString::fromUtf8("gridLayout_2"));
        comboBox = new QComboBox(frame_2);
        comboBox->addItem(QString());
        comboBox->addItem(QString());
        comboBox->addItem(QString());
        comboBox->setObjectName(QString::fromUtf8("comboBox"));
        QFont font1;
        font1.setFamily(QString::fromUtf8("\345\276\256\350\275\257\351\233\205\351\273\221"));
        font1.setPointSize(12);
        comboBox->setFont(font1);

        gridLayout_2->addWidget(comboBox, 0, 2, 1, 1);

        horizontalLayout = new QHBoxLayout();
        horizontalLayout->setSpacing(6);
        horizontalLayout->setObjectName(QString::fromUtf8("horizontalLayout"));
        pushButton_4 = new QPushButton(frame_2);
        pushButton_4->setObjectName(QString::fromUtf8("pushButton_4"));

        horizontalLayout->addWidget(pushButton_4);

        pushButton_3 = new QPushButton(frame_2);
        pushButton_3->setObjectName(QString::fromUtf8("pushButton_3"));

        horizontalLayout->addWidget(pushButton_3);

        pushButton_2 = new QPushButton(frame_2);
        pushButton_2->setObjectName(QString::fromUtf8("pushButton_2"));

        horizontalLayout->addWidget(pushButton_2);

        lineEdit = new QLineEdit(frame_2);
        lineEdit->setObjectName(QString::fromUtf8("lineEdit"));
        QFont font2;
        font2.setFamily(QString::fromUtf8("\345\276\256\350\275\257\351\233\205\351\273\221"));
        lineEdit->setFont(font2);

        horizontalLayout->addWidget(lineEdit);

        pushButton = new QPushButton(frame_2);
        pushButton->setObjectName(QString::fromUtf8("pushButton"));
        QFont font3;
        font3.setFamily(QString::fromUtf8("\345\276\256\350\275\257\351\233\205\351\273\221"));
        font3.setPointSize(16);
        pushButton->setFont(font3);

        horizontalLayout->addWidget(pushButton);

        pushButton_5 = new QPushButton(frame_2);
        pushButton_5->setObjectName(QString::fromUtf8("pushButton_5"));
        pushButton_5->setFont(font2);

        horizontalLayout->addWidget(pushButton_5);

        pushButton_6 = new QPushButton(frame_2);
        pushButton_6->setObjectName(QString::fromUtf8("pushButton_6"));
        pushButton_6->setFont(font2);

        horizontalLayout->addWidget(pushButton_6);

        horizontalSpacer = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

        horizontalLayout->addItem(horizontalSpacer);


        gridLayout_2->addLayout(horizontalLayout, 0, 0, 1, 1);

        horizontalSpacer_2 = new QSpacerItem(40, 20, QSizePolicy::Expanding, QSizePolicy::Minimum);

        gridLayout_2->addItem(horizontalSpacer_2, 0, 1, 1, 1);

        label = new QLabel(frame_2);
        label->setObjectName(QString::fromUtf8("label"));
        label->setFont(font2);

        gridLayout_2->addWidget(label, 0, 3, 1, 1);


        gridLayout_3->addWidget(frame_2, 0, 0, 1, 1);

        frame = new QFrame(centralWidget);
        frame->setObjectName(QString::fromUtf8("frame"));
        QSizePolicy sizePolicy1(QSizePolicy::Preferred, QSizePolicy::Preferred);
        sizePolicy1.setHorizontalStretch(0);
        sizePolicy1.setVerticalStretch(6);
        sizePolicy1.setHeightForWidth(frame->sizePolicy().hasHeightForWidth());
        frame->setSizePolicy(sizePolicy1);
        frame->setFrameShape(QFrame::Box);
        frame->setFrameShadow(QFrame::Raised);
        gridLayout = new QGridLayout(frame);
        gridLayout->setSpacing(5);
        gridLayout->setContentsMargins(11, 11, 11, 11);
        gridLayout->setObjectName(QString::fromUtf8("gridLayout"));
        gridLayout->setContentsMargins(0, 0, 0, 0);
        webEngineView = new QWebEngineView(frame);
        webEngineView->setObjectName(QString::fromUtf8("webEngineView"));
        webEngineView->setUrl(QUrl(QString::fromUtf8("about:blank")));

        gridLayout->addWidget(webEngineView, 0, 0, 1, 1);


        gridLayout_3->addWidget(frame, 1, 0, 1, 1);

        mainToolBar->addAction(actionaa);
        mainToolBar->addSeparator();

        retranslateUi(MainWindowClass);

        QMetaObject::connectSlotsByName(MainWindowClass);
    } // setupUi

    void retranslateUi(QMainWindow *MainWindowClass)
    {
        MainWindowClass->setWindowTitle(QCoreApplication::translate("MainWindowClass", "MainWindow", nullptr));
        actionaa->setText(QCoreApplication::translate("MainWindowClass", "aa", nullptr));
#if QT_CONFIG(shortcut)
        actionaa->setShortcut(QCoreApplication::translate("MainWindowClass", "Ctrl+O", nullptr));
#endif // QT_CONFIG(shortcut)
        comboBox->setItemText(0, QString());
        comboBox->setItemText(1, QCoreApplication::translate("MainWindowClass", "www.baidu.com", nullptr));
        comboBox->setItemText(2, QCoreApplication::translate("MainWindowClass", "www.csdn.net", nullptr));

};

namespace Ui {
    class MainWindowClass: public Ui_MainWindowClass {};
} // namespace Ui

QT_END_NAMESPACE

#endif // UI_MAINWINDOW_H

3.运行结果如下

三、在线协助:

如需安装运行环境或远程调试,见文章底部个人 QQ 名片,由专业技术人员远程协助!
1)远程安装运行环境,代码调试
2)Qt, C++, Python入门指导
3)界面美化
4)软件制作

 当前文章连接:https://blog.csdn.net/alicema1111/article/details/132666851

博主推荐文章:python人脸识别统计人数qt窗体-CSDN博客

博主推荐文章:Python Yolov5火焰烟雾识别源码分享-CSDN博客

                         Python OpenCV识别行人入口进出人数统计_python识别人数-CSDN博客

个人博客主页:alicema1111的博客_CSDN博客-Python,C++,网页领域博主

博主所有文章点这里:https://blog.csdn.net/alicema1111?type=blog

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/970773.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

MySQL性能分析工具的使用

1. 数据库服务器的优化步骤 当我们遇到数据库调优问题的时候&#xff0c;该如何思考呢&#xff1f;这里把思考的流程整理成下面这张图。 整个流程划分成了 观察&#xff08; Show status &#xff09; 和 行动&#xff08; Action &#xff09; 两个部分。字母 S 的部分…

Vue框架--Vue中的计算属性

下面&#xff0c;我们来实现一个这样的需求。 实现输入框1和输入框2中文字内容的拼接。

你应该知道的几个大数据平台相关术语

你应该知道的几个大数据平台相关术语 1、大数据平台&#xff1a;一个全面的信息处理和分析系统&#xff0c;它能处理和分析海量、多样性的数据&#xff0c;从而为企业提供决策支持。 2、数据脱敏&#xff1a;是指对某些敏感信息通过脱敏规则进行数据的变形&#xff0c;实现敏…

JavaScript(内置对象)

目录 一&#xff0c;JavaScript内置对象二&#xff0c;Array对象2.1&#xff0c;常用属性和方法2.2&#xff0c;基本方法 三&#xff0c;Date对象3.1&#xff0c;常用方法3.2&#xff0c;小案例 四&#xff0c;Math对象 一&#xff0c;JavaScript内置对象 Array&#xff1a;用于…

ToBeWritten之基于ATTCK的威胁狩猎

也许每个人出生的时候都以为这世界都是为他一个人而存在的&#xff0c;当他发现自己错的时候&#xff0c;他便开始长大 少走了弯路&#xff0c;也就错过了风景&#xff0c;无论如何&#xff0c;感谢经历 转移发布平台通知&#xff1a;将不再在CSDN博客发布新文章&#xff0c;敬…

解决IDEA中java的system.properties乱码问题

在拉了别人的代码到本地后发现system.properties中中文注释都变成了乱码&#xff0c;故记录下解决步骤&#xff0c;供参考&#xff0c;我的系统是mac系统 1、在IDEA中打开设置&#xff0c;IDEA--->Preferences 2、点击Editor-->File Encodings 3、图中三处选择UTF-8&…

【设计模式】我终于读懂了职责链模式。。。

文章目录 &#x1f36a;学校 OA 系统的采购审批项目&#x1f36a;传统方案解决OA 系统审批&#xff0c;传统的设计方案(类图)&#x1f36a;传统方案解决OA 系统审批问题分析&#x1f36a;职责链模式基本介绍&#x1f36a;职责链模式的原理类图&#x1f36a;对原理类图的说明-即…

Python+Requests+Pytest+Excel+Allure 接口自动化测试项目实战【框架之间的对比】

--------UnitTest框架和PyTest框架的简单认识对比与项目实战-------- 定义&#xff1a; Unittest是Python标准库中自带的单元测试框架&#xff0c;Unittest有时候也被称为PyUnit&#xff0c;就像JUnit是Java语言的标准单元测试框架一样&#xff0c;Unittest则是Python语言的标…

华为云 异构数据迁移

数据库和应用迁移 UGO&#xff08;Database and Application Migration UGO&#xff0c;以下简称为UGO&#xff09;是专注于异构数据库结构迁移的专业服务。可将源数据库中的DDL、DML和DCL一键自动转换为华为云GaussDB/RDS的SQL语法&#xff0c;通过数据库评估、对象迁移两大核…

本地电脑搭建Web服务器建立一个属于自己的网页该如何操作呢?

本地电脑搭建Web服务器并用cpolar发布至公网访问 文章目录 本地电脑搭建Web服务器并用cpolar发布至公网访问前言1. 首先在电脑安装PHPStudy、WordPress、cpolar2. 安装cpolar&#xff0c;进入Web-UI界面3. 安装wordpress4. 进入wordpress网页安装程序5. 利用cpolar建立的内网穿…

USB Server适用于哪些场景?

具体什么情况适合使用USB Server呢&#xff1f; 一句话&#xff0c; 只要企业内有多个USB设备&#xff0c;就可以考虑使用USB Server。 目前用USB Server比较多的&#xff0c; 主要还有以下三种情况&#xff0c; 虚拟机中要连接USB 必须使用USB Server 来实现加密狗或者前…

架构设计基础设施保障IaaS之网络

目录 1 DNS运用1.1 DNS功能作用1.2 DNS配置实践 2 DNS生产最佳实践方案2.1 全球加速功能2.2 不同运营商的加速方案2.3 全球业务高可用方案2.4 跨地域负载均衡 3 DNS域名劫持解决方案4 CDN剖析4.1 CDN原理4.2 缓存过期配置处理流程4.3 缓存配置规则 5 CDN运用6 CDN最佳实践方案6…

NSSCTF web 刷题记录1

文章目录 前言题目[GXYCTF 2019]禁止套娃方法一方法二 [NCTF 2019]Fake XML cookbook[NSSRound#7 Team]ec_RCE[NCTF 2018]Flask PLUS 前言 今天是2023.9.3&#xff0c;大二开学前的最后一天。老实说ctf的功力还是不太够做的题目太少&#xff0c;新学期新气象。不可急于求成&am…

批量重命名、转换格式,让你的视频焕然一新!

你是否曾经遇到过需要批量重命名或转换视频格式的情况&#xff1f;在这个数字化时代&#xff0c;我们经常需要处理大量的视频文件&#xff0c;但是命名混乱、格式不兼容等问题常常让我们头疼。现在&#xff0c;我们为你提供了一个全面、高效的解决方案&#xff0c;让你的视频管…

JVM类的加载相关的问题

JVM类的加载相关的介绍 学习类的加载的加载过程对深入理解JVM有十分重要的作用&#xff0c;下面就跟我一起学习JVM类的加载过程吧&#xff01; 文章目录 JVM类的加载相关的介绍一、类的加载过程二、双亲委派机制1、类加载器的种类2、为什么JVM要分成不同的类的加载器3、类的加…

AIGC风暴席卷出版业,探索人工智能与创造力的融合

随着时代的不断发展&#xff0c;人工智能技术正逐渐深入并改变着各行各业&#xff0c;其中包括传统的出版行业。最近独家连载于微信读书的刑侦小说《马一鸣从警记》的成功&#xff0c;以及其中使用到的AI工具在策划、编校、推广和封面设计上的辅助&#xff0c;不仅为出版行业带…

windows下的mysql安装部署和配置环境

目录 一、下载&#xff08;mysql下载链接&#xff09; 1.进入官网选择下载 2.拉到最底下&#xff0c;选择社区版下载 3.选择mysql community server 4.选择数据库版本&#xff0c;以及系统和安装方式&#xff08;这里我选的msi&#xff09; 5.直接点击no thanks,just sta…

Unity 安卓(Android)端AVProVideo插件播放不了视频,屏幕一闪一闪的

编辑器运行没有问题&#xff0c;但是安卓就有问题&#xff0c;在平板上运行就会报错&#xff1a; vulkan graphics API is notsupported 说不支持Vulkan图形API,解决方法&#xff1a;把Vulkan删除掉

NPM 常用命令(二)

目录 1、npm bugs 1.1 配置 browser registry 2、npm cache 2.1 概要 2.2 详情 2.3 关于缓存设计的说明 2.4 配置 cache 3、 npm ci 3.1 描述 3.2 配置 install-strategy legacy-bundling global-style omit strict-peer-deps foreground-scripts ignore-s…