需要用msvc编译器编译,先安装VisoStdio 2017 然后在qt里配置使用msvc编译器。
QT +=webenginewidgets
QT += webchannel webengine
#include
#include
#include
#include
m_webView = new QWebEngineView(this);
QHBoxLayout* layout = new QHBoxLayout();
layout->addWidget(m_webView);
ui->widget_26->setLayout(layout);
m_webView1 = new QWebEngineView(this);
QHBoxLayout* layout1 = new QHBoxLayout();
layout1->addWidget(m_webView1);
ui->widget_25->setLayout(layout1);
m_webView2 = new QWebEngineView(this);
QHBoxLayout* layout2 = new QHBoxLayout();
layout2->addWidget(m_webView2);
ui->widget_24->setLayout(layout2);
webChannel = new QWebChannel();
m_webView->page()->setWebChannel(webChannel);
webChannel1 = new QWebChannel();
m_webView1->page()->setWebChannel(webChannel1);
webChannel2 = new QWebChannel();
m_webView2->page()->setWebChannel(webChannel2);