[Qtscript-bindings] QScriptValue::isFunction() in 4.5

syntheticpp at gmx.net syntheticpp at gmx.net
Tue Jan 6 14:57:31 CET 2009


> Right, QObject doesn't implement hasInstance(). Of the built-in object
> types only Function implements hasInstance(). With Qt 4.5 you can
> implement it for custom types (see
> http://doc.trolltech.com/main-snapshot/qscriptclass.html#extension).
> It sounds like your script is applying the instanceof operator to an
> object created with QScriptEngine::newQObject(). I'm sorry that it
> breaks now, but it should never have been working in the first place.
> :-( Maybe you can share some more information on what the script is
> doing, then it's easier to suggest a proper solution.

OK, the patch is wrong. And you are right, I use newQObject() with a 
QScriptable object as constructor.
It seems I have too redesign this code and to use a simple creator function, or
do you know a better way. (I've tried so set the prototype of the ctor object
to Function.prototype, but this doesn't help either)

Peter

-- 
Sensationsangebot verlängert: GMX FreeDSL - Telefonanschluss + DSL 
für nur 16,37 Euro/mtl.!* http://dsl.gmx.de/?ac=OM.AD.PD003K1308T4569a


More information about the Qtscript-bindings mailing list