[Qt-qml] Exporting overloaded methods to QML

Artur Souza (MoRpHeUz) artur.souza at openbossa.org
Fri Jun 18 21:28:13 CEST 2010


On Fri, Jun 18, 2010 at 6:10 AM, Kent Hansen <kent.hansen at nokia.com> wrote:
> I _think_ you should be able to get the engine by creating a C++ slot
> that takes a QScriptValue as argument, call that slot from QML, and call
> QScriptValue::engine() on the argument. If thats works, it effectively
> means we do already expose the QtScript API in public, but not with the
> intention to use the full API (e.g., it should be fine to call
> toNumber() on the QScriptValue, but not, say, installing a custom
> QScriptEngineAgent on the engine()).

As you said, this worked. I got the arguments ans QScriptValue and
then got the engine, the context and checked the number of arguments
and could handle them properly.

Thanks for the help!

PS: I'm still interested about knowing the chances of making
QScriptable classes work properly ;)

Cheers!

-- 
-------------------------------------------------------
Artur Duque de Souza
openBossa
INdT - Instituto Nokia de Tecnologia
-------------------------------------------------------
Blog: http://blog.morpheuz.cc
PGP: 0xDBEEAAC3 @ wwwkeys.pgp.net
-------------------------------------------------------



More information about the Qt-qml mailing list