QWebEngineView 如何调试页面

重点是使用 方法  qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "5566"); 
例子如下:
MainWindow::MainWindow(QWidget *parent) 
:QMainWindow(parent),    
ui(new Ui::MainWindow)
{    
    ui->setupUi(this);   
    qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "5566");    
    QWebEngineView *en = new QWebEngineView(this);   
    en->settings()->setAttribute(QWebEngineSettings::PluginsEnabled, true);     
    en->settings()->setAttribute(QWebEngineSettings::SpatialNavigationEnabled, true);   
    en->setGeometry(0,0,500,500);    
    en->load(QUrl("http://static.jszg.edu.cn/public/tongzhi.html"));
}

 

QWebEngineView 如何调试页面_第1张图片

 

在谷歌浏览器里输入 http://17.0.0.1:5566 ,即可调试

QWebEngineView 如何调试页面_第2张图片

你可能感兴趣的:(QWebEngineView 如何调试页面)