[Qt-interest] JavascriptCanOpenWindows can't

Kelly Burkhart kelly.burkhart at gmail.com
Wed Jan 13 22:52:06 CET 2010


Hello,

I'm working with QtWebKit and am trying to make javascript interact
with my c++ code.  I've written a trivial application that loads html
from a file.  The html provides a couple of buttons that trigger
javascript functions.  I've exposed a c++ object into the javascript
context with QWebFrame::addToJavaScriptWindowObject and am able to
trigger a c++ slot with a javascript function.

I'm now trying (and failing) to open a new window from a javascript function:

window.open("test_page.html", "", "resizable=1");

This works from firefox and from arora, but from my app, no new window
appears.  I have set the JavascriptEnabled and
JavascriptCanOpenWindows websettings.  Should QtWebKit interpret the
window.open call and pop up a new window for me?  Or do I need to
intercept that call somehow from the c++ side of things and create a
new window myself?

Thanks in advance for your help,

-Kelly



More information about the Qt-interest-old mailing list