Menu

Activate the inspector (debug)in the WebView component

2016-02-15
2016-02-15
  • Pier Andrea Serra

    Hi Stefan,
    I activated the inspect function of the WebView component that acts as a debugger for Web development;
    just insert the following line in the attachToWebView(QWebView* webView) routine:

    QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
    

    the source of the complete function now is:

    void attachToWebView(QWebView* webView)
        {
            QWebSettings::globalSettings()->setAttribute(QWebSettings::DeveloperExtrasEnabled, true);
            QWebPage *page = webView->page();
            m_frame = page->mainFrame();
            javaScriptWindowObjectCleared();
            connect(m_frame, SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared()));
    
        }
    

    For inspecting the webPage in the webView just right-click with the mouse and follow the popup menu.

    Kindest regards,
    Pier Andrea.

     
  • Stefan Zieker

    Stefan Zieker - 2016-02-15

    Hi Pier,

    I have added this to the example.

    Thx,
    Stefan

     

Anonymous
Anonymous

Add attachments
Cancel