[Solved] Debugging scripts that run in a QWebView widget
-
Another solution, less intrusive is to subclass webpage and reimplement:
@
virtual void javaScriptAlert ( QWebFrame * frame, const QString & msg )
virtual bool javaScriptConfirm ( QWebFrame * frame, const QString & msg )
virtual void javaScriptConsoleMessage ( const QString & message, int lineNumber, const QString & sourceID )
virtual bool javaScriptPrompt ( QWebFrame * frame, const QString & msg, const QString & defaultValue, QString * result )
@[EDIT: added code formatting tags, Volker]
-
Thanks a lot for your follow-up Florent, that technique will indeed come useful.
-
How can I add QWebInspector to QWebView? I couldn't find any sample code.
-
I just enabled it by adding this line in the constructor of my main window:
@
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
@Then I right-click on any QWebView at runtime and I select "Inspect" - more knowledgeable people around will give deeper insight, eventually.
-
Thanks a lot, entuland. It was really helpful.
[quote author="entuland" date="1294223335"]I just enabled it by adding this line in the constructor of my main window:
@
QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
@Then I right-click on any QWebView at runtime and I select "Inspect" - more knowledgeable people around will give deeper insight, eventually.[/quote]
-
Another interesting idea that I worked with is use JsLint inside the frame.
-
Do you have sample code? Thanks.
-
Some example about using JsLint in the Qt context would interest me too!
-
Thank you! This saved me a patch of hair or two.
-
Hello entuland,
Could you please advise what solution was selected. I have the same question and still have no solution.
Thank you in advance,
Vadim