QtWebEngine调试 [英] QtWebEngine debugging

查看:584
本文介绍了QtWebEngine调试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近Qt引入了 QtWebEngine 模块。是否可以在 QWebEngineView 中调用开发人员工具并调试JavaScript代码? QWebView 使用

Recently Qt introduced the QtWebEngine module. Is there a way to invoke developer tools and debug JavaScript code inside QWebEngineView? It was possible with QWebView using

page()->settings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);

但我在 QWebEngineView

推荐答案

我刚刚遇到了这个问题,因此我在此添加了后代。

I just ran across this so I added it here for posterity.

它刚刚被添加到Qt 5.5 git中。您必须通过环境变量 QTWEBENGINE_REMOTE_DEBUGGING =< port> 启用它。如果要调试嵌入式设备并且不能使用本地控制台,则可以放置 0.0.0.0:<port> 。然后您可以指向可以连接到 http://127.0.0.1 的位置来获取调试器。它将需要是基于铬的浏览器。您必须使用Chrome,还是可以使用快速纳米浏览器示例。

It was just added to Qt 5.5 git. You have to enable it via an environment variable QTWEBENGINE_REMOTE_DEBUGGING=<port>. You can put 0.0.0.0:<port> if you are doing debugging of an embedded device and cant use the local console. Then you can point can connect to http://127.0.0.1: to get the debugger. It will need to be a chromium based browser. Do you have to use Chrome, or you can actually use the "quick nano browser" example if you want.

这篇关于QtWebEngine调试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆