首页| 论坛| 消息
主题:QT+CEF完美实现WEB与C++的混合编程
dorafather发表于 2020-11-19 13:45
1、采用QT编写的CEFVIEW作为主窗口,采用谷歌内核
2、当客户需要CS架构时(比如大量视频监控时),可嵌入之前BS的漂亮UI,加上自己的视频监控组成新的CS
3、关键代码如下:
if(m_isInitClient)
return;
m_isInitClient = true;
m_cefClient = cefClient;

m_cefTimer = new QTimer(this);
connect(m_cefTimer, SIGNAL(timeout()), this, SLOT(onCefTimer()));
m_cefTimer->start(10);
QCefClient* cefClientPtr = m_cefClient.get();
connect(cefClientPtr, SIGNAL(loadStarted(bool)), this, SIGNAL(loadStarted(bool)));
connect(cefClientPtr, SIGNAL(loadFinished(bool, bool)), this, SIGNAL(loadFinished(bool, bool)));
connect(cefClientPtr, SIGNAL(loadError(QString)), this, SIGNAL(loadError(QString)));
connect(cefClientPtr, SIGNAL(webMsgReceived(QString)), this, SIGNAL(webMsgReceived(QString)));
connect(cefClientPtr, SIGNAL(inspectorRequested()), this, SIGNAL(inspectorRequested()));
connect(cefClientPtr, SIGNAL(processQueryRequest(const QCefQuery&)),
this, SLOT(onQCefQueryRequest(const QCefQuery&)));
connect(cefClientPtr, SIGNAL(invokeMethodNotify(int, int, const QString, const QVariantList)),
this, SLOT(onInvokeMethodNotify(int, int, const QString, const QVariantList)));

浏览大图

浏览大图

浏览大图
回帖(7):
7楼:求demo放代码
6楼:这个东西好是好,当项目选型的时候想用它作为webengine的替代品,后来发现不太稳,会白屏啥的。 ..
5楼:liulin188:这个好,楼主方便搞给教程,如何编译cef,如何与qt集成~~~  (2020-11-19 22:01 ..

全部回帖(7)»
最新回帖
收藏本帖
发新帖