资源简介
实现本地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个文件信息
相关资源
- 国际象棋的qt源代码
- C语言代码高亮html输出工具
- QT上位机
- qt媒体播放器
- QT5开发及源代码
- qt完整项目
- C++ mqtt 用法
- ChartCtrl控件库(可在VS2019中使用)
- qt进度条(RoundProgressBar)
- Qt的纽带风格界面实现(Office Ribbon风
- qt 实现画板
- QT Hisi demo
- 基础qt数据库读取和显示
- Qt画图工具源码(qgraphics draw)
- Qt查询SQLite数据库
- QtWebApp
- Qt 实现心电图
- Qt实现 屏幕截图
- qt cmd实现ping
- QT实现USB摄像头拍照
- qt texteditor(富文本编辑器)
- qt 串口助手源码
- qt登录富文本编辑器和文档打印设计
- 使用QWT库实现接收串口数据,并根据
- QT SQLite封装
- QT半透明效果界面
- Qt5串口通信-windows
- 计算机远程唤醒和关机
- 使用wxWidgets进行跨平台程序开发
- QT 动态曲线
评论
共有 条评论