版本:Qt5.14
1、.pro
QT += webenginewidgets
2、头文件
#include <QWebEngineView>
3、代码
int main(int argc, char *argv[]){ QApplication a(argc, argv); QWebEngineView *view = new QWebEngineView(); view->load(QUrl("https://www.baidu.com/")); view->show(); return a.exec(); }
PS:
如果想实现通信则用QWebChannel :https://www.cnblogs.com/sigma0/p/7346727.html