[Interest] QJSEngine replacement for QScriptEngine misses newFunction

2016-05-18 Thread Walter Stefan
Hi, I am looking into migrating my code to QJSEngine, because of the deprecation of the QScriptEngine (QtScript). As we have used the functionality of newFunction very extensive and all related scripts are depending on this, the newFunction in QJSEngine is for us mandatory or something that cre

Re: [Interest] QJSEngine replacement for QScriptEngine misses newFunction

2016-02-23 Thread Walter Stefan
project.org Subject: Re: [Interest] QJSEngine replacement for QScriptEngine misses newFunction Hi Stefan, On Tuesday 23 February 2016 05:34:03 Walter Stefan wrote: [...] > > And in this way. I can use it then in the script: > value = sqrt(4); > > I actually don't want to map a who

Re: [Interest] QJSEngine replacement for QScriptEngine misses newFunction

2016-02-23 Thread nikita baryshnikov
As a workaround you can use QQmlContext::setContextObject: QQmlEngine::rootContext()->setContextObject(myMath); On Tue, Feb 23, 2016 at 2:11 PM, Stephen Bryant wrote: > Hi Stefan, > > On Tuesday 23 February 2016 05:34:03 Walter Stefan wrote: > [...] >> >> And in this way. I can use it then in th

Re: [Interest] QJSEngine replacement for QScriptEngine misses newFunction

2016-02-23 Thread Stephen Bryant
Hi Stefan, On Tuesday 23 February 2016 05:34:03 Walter Stefan wrote: [...] > > And in this way. I can use it then in the script: > value = sqrt(4); > > I actually don't want to map a whole QObject, because that would require a > call like this: value = MyMath.sqrt(4); > > Is there any way to ac

[Interest] QJSEngine replacement for QScriptEngine misses newFunction

2016-02-22 Thread Walter Stefan
Hi, I am looking into migrating my code to QJSEngine, because of the deprecation of the QScriptEngine (QtScript). As we have used the functionality of newFunction very extensive and all related scripts are depending on this, the newFunction in QJSEngine is for us mandatory or something that cre