资源简介
实现本地c++与嵌入的html页面通信。使用QTWebEngineView.
非常适用于qt应用程序嵌入html的情况
代码片段和文件信息
/****************************************************************************
**
** Copyright (C) 2015 The Qt Company Ltd.
** Contact: http://www.qt.io/licensing/
**
** This file is part of the demonstration applications of the Qt Toolkit.
**
** $QT_BEGIN_LICENSE:LGPL$
** Commercial License Usage
** Licensees holding valid commercial Qt licenses may use this file in
** accordance with the commercial license agreement provided with the
** Software or alternatively in accordance with the terms contained in
** a written agreement between you and The Qt Company. For licensing terms
** and conditions see http://www.qt.io/terms-conditions. For further
** information use the contact form at http://www.qt.io/contact-us.
**
** GNU Lesser General Public License Usage
** Alternatively this file may be used under the terms of the GNU Lesser
** General Public License version 2.1 as published by the Free Software
** Foundation and appearing in the file LICENSE.LGPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU Lesser General Public License version 2.1 requirements
** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
**
** As a special exception The Qt Company gives you certain additional
** rights. These rights are described in The Qt Company LGPL Exception
** version 1.1 included in the file LGPL_EXCEPTION.txt in this package.
**
** GNU General Public License Usage
** Alternatively this file may be used under the terms of the GNU
** General Public License version 3.0 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file. Please review the following information to
** ensure the GNU General Public License version 3.0 requirements will be
** met: http://www.gnu.org/copyleft/gpl.html.
**
**
** $QT_END_LICENSE$
**
****************************************************************************/
#include “document.h“
void Document::setSendTextText(const QString &text)
{
s_text = text;
emit sendText(s_text);
}
void Document::displayMessage(const QString &message)
{
mainUi->editor->appendPlainText(message);
}
/*!
This slot is invoked from the HTML client side and the text displayed on the server side.
*/
void Document::receiveText(const QString &r_text)
{
displayMessage(Qobject::tr(“Received message: %1“).arg(r_text));
}
void Document::setUi(Ui::MainWidget *ui)
{
mainUi = ui;
}
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 90 2017-09-13 16:47 webchanneltest\debug\debug.log
文件 139776 2016-01-12 03:24 webchanneltest\debug\webchanneltest.exe
文件 3182592 2016-01-12 03:24 webchanneltest\debug\webchanneltest.pdb
文件 2483 2016-01-12 09:13 webchanneltest\document.cpp
文件 2640 2016-01-12 09:12 webchanneltest\document.h
文件 2531903 2017-09-11 16:58 webchanneltest\echarts.js
文件 6001 2017-09-13 17:46 webchanneltest\HelloWorld2.html
文件 421 2016-01-12 02:04 webchanneltest\htmlpage.cpp
文件 2164 2016-01-12 08:01 webchanneltest\index.html
文件 186 2017-09-13 16:28 webchanneltest\main.cpp
文件 828 2017-09-13 17:38 webchanneltest\mainwidget.cpp
文件 455 2017-09-13 17:38 webchanneltest\mainwidget.h
文件 2129 2016-01-12 07:58 webchanneltest\mainwidget.ui
文件 24491 2016-01-12 03:25 webchanneltest\Makefile
文件 78909 2016-01-12 03:25 webchanneltest\Makefile.Debug
文件 78942 2016-01-12 03:25 webchanneltest\Makefile.Release
文件 16085 2016-12-15 18:49 webchanneltest\qwebchannel.js
文件 3876 2016-01-12 09:13 webchanneltest\release\document.obj
文件 2207 2016-01-12 09:12 webchanneltest\release\main.obj
文件 94651 2016-01-12 22:29 webchanneltest\release\mainwidget.obj
文件 6106 2016-01-12 09:12 webchanneltest\release\moc_document.cpp
文件 7388 2016-01-12 09:12 webchanneltest\release\moc_document.obj
文件 3453 2016-01-12 09:12 webchanneltest\release\moc_mainwidget.cpp
文件 3432 2016-01-12 09:13 webchanneltest\release\moc_mainwidget.obj
文件 2743 2016-01-12 08:33 webchanneltest\release\moc_previewpage.cpp
文件 2777 2016-01-12 08:33 webchanneltest\release\moc_previewpage.obj
文件 3086 2016-01-12 08:33 webchanneltest\release\previewpage.obj
文件 33961 2016-01-12 08:33 webchanneltest\release\qrc_webchanneltest.cpp
文件 11627 2016-01-12 08:33 webchanneltest\release\qrc_webchanneltest.obj
文件 59392 2016-01-12 22:29 webchanneltest\release\webchanneltest.exe
............此处省略11个文件信息
相关资源
- MFC中用CHtmlView作的浏览器
- QT c++ dijkstra最短路径工程源码
- TeeChart8.ocx微软原配
- 酒店管理系统 QT/C++
- 传智播客_Qt 教程 +代码.7z
- c++QT5新版画任意阶贝塞尔曲线完整工
- c++与Qt使用数据库MySQL进行数据的增删
- C++调用海康工业相机SDK采集图像的简
- Osg3.4.1Earth2.8-Qt5.6-VC2013-X86-Release.rar
- C++ Qt设计模式 第2版(中文版).pdf
- C++ GUI Qt4编程第二版(中文高清PDF扫描
- C++结合Qt库编写的背单词软件源代码
- 基于qt的聊天室
- C++ GUI Qt 4编程(第二版)(中文高清
- qt-eclipse-integration-linux.x86-1.6.1.tar.gz(
- 基于QT5的简化版黄金矿工
- 基于QT的商品销售管理系统
- squish 帮助手册
- 基于QT的C++图片查看浏览器的设计与实
- C++结合Qt库编写的背单词软件源代码
- High-speed Charting Control--MFC
- Qt版黑白棋251471
-
Qt使用QMediaPla
yer制作的视频播放器 - teechart代码教程
- c++ & QT 餐厅服务系统
- VS2010——Mschart应用成功
- MFC 常用界面组件集合CGridCtrl
- mschart控件安装使用说明
- 系统托盘自定义图标工具
- 哈夫曼编码压缩c++版和QT5版 QT5版实现
评论
共有 条评论