[Qt-interest] Invoke function in JavaScript

Joshua Lee muzili at gmail.com
Wed Dec 15 04:56:13 CET 2010


Hi No'am,
I want pass C++ value to javascript function 'foobar', 
how to get it?

Best regards,
Joshua

On Tue, 14 Dec 2010, noam.rosenthal at nokia.com wrote:

> Do you mean invoke javascript-defined function from C++?
> Yes.
> 
> script:
> 
> function foobar() {
>   ... do something ...
> }
> 
> c++
> 
> QScriptValue foobarFunction = scriptEngine->evaluate("foobar");
> QScriptValue returnValue = foobarFunction.call();
> 
> See http://doc.qt.nokia.com/4.7/qscriptengine.html#evaluating-scripts
> 
> No'am
> ________________________________________
> From: qt-interest-bounces at trolltech.com [qt-interest-bounces at trolltech.com] On Behalf Of ext Zhongmiao Li [mars.leezm at gmail.com]
> Sent: Tuesday, December 14, 2010 5:07 AM
> To: Qt-interest
> Subject: [Qt-interest] Invoke function in JavaScript
> 
> Hi everyone,
> 
> when using QScript, is it possible to invoke a function defined in JavaScript? Thank you!
> 

-- 
Joshua Lee





More information about the Qt-interest-old mailing list