0
votes

I am using QWebView to display html in my app. I set html by using QWebView::setHtml() function.

Problem is that accessing DOM before loadFinished does not work. But after loadFinished it works. So I guess DOM is available only after loading. I want to check DOM content just after setHtml() but before show().

Is it Possible? If possible what is the way to access DOM before calling show() on QWebView. There is no function in docs like startLoad().

I am using Qt 4.8 on Windows 8.

1
No comments / answers yet. Is question clear or need more information. Please let me know - stackOverflow

1 Answers

0
votes

Did you try the following:

In the constructor:

{
    // ...
    webView->setHtml( /* ... */ );

    connect( webView, SIGNAL( loadFinished( bool ) ),
             this,    SLOT( onLoadFinished( bool ) ) );
    // ...
}

In the slot:

void onLoadFinished( bool )
{
    // Check what you want.
    // ...

    // Show after you finished your work.
    webView->show();
}