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 create开发者_JAVA技巧Window never seems to return anything but NULL and never a QWebPage. Why is this happening?
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.
精彩评论