当前位置: 首页 > news >正文

怎样做网站发布信息南京seo排名

怎样做网站发布信息,南京seo排名,网络服务协议需要交印花税吗,库尔勒市建设路街道办网站文章目录 一、环境准备 二、代码实现 三、测试 一、环境准备 首先,确保你的Qt安装包含了QtWebEngine模块。我的Qt是5.12.9并且使用MSVC来编译项目。在项目文件中需要添加以下配置,其中在Qt中配置MSVC,建议去看看这位大佬的博客&#xff1a…

文章目录

一、环境准备

二、代码实现

三、测试


一、环境准备

首先,确保你的Qt安装包含了QtWebEngine模块。我的Qt是5.12.9并且使用MSVC来编译项目。在项目文件中需要添加以下配置,其中在Qt中配置MSVC,建议去看看这位大佬的博客:Qt 添加MSVC2017编译器(2022年保姆级教程,不安装完整VS)_qt msvc2017-CSDN博客

确保:

QT += core gui webenginewidgets

二、代码实现

mainwindow.cpp,主要实现的简单网页浏览器,其通过QWebEngineView组件实现了网页内嵌功能。如下为测试demo文件代码:

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QWebEngineView>
#include <QWebEnginePage>
#include <QWebEngineProfile>
#include <QStyle>
#include <QApplication>MainWindow::MainWindow(QWidget *parent): QMainWindow(parent), ui(new Ui::MainWindow)
{ui->setupUi(this);// 设置窗口标题和大小setWindowTitle("Web Browser");resize(1024, 768);// 创建工具栏toolBar = new QToolBar(this);addToolBar(toolBar);// 创建地址栏urlLineEdit = new QLineEdit(this);urlLineEdit->setPlaceholderText("Enter URL (e.g., https://www.google.com)");urlLineEdit->setStyleSheet("QLineEdit { padding: 5px; border-radius: 3px; }");toolBar->addWidget(urlLineEdit);// 创建前进按钮goButton = new QPushButton("Go", this);goButton->setStyleSheet("QPushButton { padding: 5px 15px; background-color: #4CAF50; color: white; border: none; border-radius: 3px; }""QPushButton:hover { background-color: #45a049; }");toolBar->addWidget(goButton);// 创建网页视图webView = new QWebEngineView(this);setCentralWidget(webView);// 创建进度条progressBar = new QProgressBar(this);progressBar->setMaximumHeight(2);progressBar->setTextVisible(false);progressBar->setStyleSheet("QProgressBar { border: none; background-color: #f0f0f0; }""QProgressBar::chunk { background-color: #4CAF50; }");statusBar()->addPermanentWidget(progressBar);// 连接信号和槽connect(goButton, &QPushButton::clicked, this, &MainWindow::loadPage);connect(urlLineEdit, &QLineEdit::returnPressed, this, &MainWindow::loadPage);connect(webView, &QWebEngineView::urlChanged, this, &MainWindow::updateUrl);connect(webView, &QWebEngineView::loadProgress, this, &MainWindow::updateProgress);connect(webView, &QWebEngineView::titleChanged, this, &MainWindow::updateTitle);// 设置初始页面webView->setUrl(QUrl("https://www.google.com"));
}MainWindow::~MainWindow()
{delete ui;
}void MainWindow::loadPage()
{QString url = urlLineEdit->text();if (!url.startsWith("http://") && !url.startsWith("https://")) {url = "https://" + url;}webView->setUrl(QUrl(url));
}void MainWindow::updateUrl(const QUrl &url)
{urlLineEdit->setText(url.toString());
}void MainWindow::updateProgress(int progress)
{progressBar->setValue(progress);if (progress == 100) {progressBar->hide();} else {progressBar->show();}
}void MainWindow::updateTitle(const QString &title)
{setWindowTitle(title + " - Web Browser");
}

三、测试

1.打开博客网页:

2.打开B站网页: 

 

 合理!!!!!

http://www.dtcms.com/a/487907.html

相关文章:

  • 品牌电商网站设计领卷网站怎么做的
  • 网站代电子商务建立网站前期准备
  • Matlab安装硬件支持包
  • 接口测试 | Postman的安装和测试使用
  • 江门广告网站推广技巧网站全部用根目录
  • Linux -- 线程概念
  • 湛江免费建站杭州网络有限公司
  • Zabbix 监控系统模板、监控项、图形方位指南
  • 网站建设都有哪些搬瓦工wordpress
  • 网站不交换友情链接可以吗网站建设公司讯息
  • 免费建微网站平台网站建设福州
  • 迁移后运维与监控:构建企业级RustFS运维体系
  • 做网站优化竞价区别wordpress选了中文还是英文版
  • c2c网站建设要多少钱北京市建设质量监督网站
  • 【Linux系统】文件IO
  • 网站建设咨询什么wordpress 热门关键字
  • 制作网站首先要知道什么做网站运用的技术
  • discuz做的网站做英文网站要会什么
  • 如何在国外网站做免费推广发布网站后备案
  • 网站制作建设公司wordpress vue
  • 广州网站建设哪里好外网网站管理制度建设
  • 网站推广工作是在网站发布之后开展的龙海网络推广
  • Debian12安装Docker、Docker-compose构建CICD
  • AI在物理实验教育中的应用探索
  • 第四章 决策树
  • 【算法】725.分割链表--通俗讲解
  • 哈尔滨网站seowordpress域名设置
  • kettle Spoon 数据库连接步骤详解
  • 网站建设要做什么网站美化
  • Springboot——使用shyiko监听mysql的bin-log