QT 5.4 WebEngine dev tools for javascript

I am creating an application using QWebEngineView and QWebEnginePage. I was wondering if there is a way to activate Web Dev tools?

I need to debug html code, javascript, how you do it using the Google Developer Tool in Chrome.

If this is not possible in QT 5.4, does anyone know when it is planned to include QT in future versions?

+4
source share
4 answers

add this line to your code

#ifdef QT_DEBUG qputenv("QTWEBENGINE_REMOTE_DEBUGGING", "9000"); #endif 

after launching the application, run google chrome, then go to http: // localhost: 9000 , you will get developer tools

+4
source

You can do this with the old QWebView, see QWebSettings :: DeveloperExtrasEnabled .

Documents have nothing to do with QWebEngineView, but I found a link (see line 47). I have not tried if it works, but you can try. Perhaps the dev tools will be available in one of the next versions of QT.

0
source

And here is a slightly more flexible solution: run the application with the command line parameter - remote-debugging-port = XXXX . It is automatically routed using QApplication for the internal components of Blink (or any other QWebEngine), so there is no additional work such as parsing arguments; and it can be changed without restoring the application.

Update: to be honest, I used it only with 5.5 and 5.6, maybe it is not supported in 5.4

0
source

set the command line "remote-debugging-port = XXXX", but there is a problem when the application exits, it will crash

0
source

Source: https://habr.com/ru/post/978323/


All Articles