[Qt-interest] addToJavaScriptWindowObject and javascript arguments object
Andrew Gorelik
gorelik at andrewz.org
Wed Jul 22 22:27:33 CEST 2009
Hi all,
I am writing a QT application which uses WebKit and needs to accept
calls from the existing JavaScript code.
I've defined an calss with methods corresponding to JavaScript
function calls, I pass an instance of this class to
QWebFrame::addToJavaScriptWindowObject(), and it all works fine as long
as I am passing simple types (such as int) to my JavaScript calls.
My problem is, one of the JavaScript calls passes an arguments objects
to the call. I am not sure what C++ class corresponds to this. If I
use QString, I get "[object Arguments]", which is not too helpful. If
I use QObject, the method doesn't get called at all.
So the question is this: what C++ class should I use as the argument
type in the object given to addToJavaScriptWindowObject() to match the
JavaScript arguments object?
I've spent literally days trying to google for the answer, but to no
avail: all (few) examples of addToJavaScriptWindowObject out there use
simple types, like integers and strings. So my last resort is to ask
for your collective wistom.
Thank you,
Andrew
More information about the Qt-interest-old
mailing list