[Qt-interest] Adding custom (native) JavaScript functions to QML engine?

John McKisson john.mckisson at gmail.com
Mon Mar 22 13:33:47 CET 2010


I know it is documented that the global script object of the
QScriptEngine used by QDeclarativeEngine is not modifiable, but
my application requires that I be able to add native functions that
can be called from within the context of a QML Component.

Normally this would be done simply by adding a new property to the
script globalObject (or sub property) but I see no documented
way to accomplish this.

It appears it can easily be done with some of my own modifications to
the QDeclarativeEngine code but I would rather not do this
as it breaks portability.

Is this even possible with the current implementation of QML?  The
future of my application depends on it =/

Thanks,
John



More information about the Qt-interest-old mailing list