作者: shaoliang 2020-04-09 08:46   访问数:903
pro 文件
QT += core gui webenginewidgets
头文件
#include 【QWidget】 --改为<
#include 【QWebEngineView】
private:
Ui::Dialog *ui;
QWebEngineView *view;
};
cpp
#include "dialog.h"
#include "ui_dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog)
{
ui->setupUi(this);
view=new QWebEngineView(this);
view->resize(this->size());
view->load(QUrl(QStringLiteral("https://www.51dr.top")));
}
Dialog::~Dialog()
{
delete view;
delete ui;
}
上一条:QT QMessageBox 下一条:ubuntu19安装 vmware