please delete me
please delete me

Reputation: 721

QtWebkit: Support for javascript page opens?

I'm trying to get QtWebkit to allow page opens via Javascript without success.

I don't use QWebView, only QWebPage (running headless). I derived from QWebPage and overrode createWindow (currently my override just logs a message and calls the base createWindow). I also set JavascriptCanOpenWindows to true.

My function is called but the base createWindow never seems to return anything but NULL and never a QWebPage. Why is this happening?

Upvotes: 0

Views: 1867

Answers (1)

Yuriy Al. Shirokov
Yuriy Al. Shirokov

Reputation: 188

It looks like the createWindow() from the QWebPage implementation returns NULL.

In my program I return the instance of my class derived from QWebPage from the createWindow(). To customize the processing of the new page I re-implement the acceptNavigationRequest() method.

It was very helpful for me to read the browser application example from the Qt examples which shows how it handles creation of a new window.

Upvotes: 2

Related Questions