[Qt-interest] Problem about QScript

Zhongmiao Li mars.leezm at gmail.com
Mon Dec 13 12:15:47 CET 2010


Thank you!  In fact I'm writing in QtJambi and I have turned to QtJambi
mailing list, but they are not familiar with QScript.
My code is as following:

QScriptValue tmp=engine.newQObject(object,
QScriptEngine.ValueOwnership.QtOwnership,
                QScriptEngine.QObjectWrapOption.PreferExistingWrapperObject,
                QScriptEngine.QObjectWrapOption.ExcludeSuperClassContents);

boolean isObj= tmp.isObject();
boolean isUNDefined=tmp.isUndefined();
        return tmp;

 I have checked isObj, it's true;  and I also checked isUNDefined, it's
false.

So do you know if there is some other possibility that causes this problem?
 Thanks very much!



On Mon, Dec 13, 2010 at 1:16 AM, Xiaolei Shang <xiaolei.shang at cobham.com>wrote:

>  Hi:
>
> Hi everyone,
> is someone familiar with QScript?
> And do you know what usually causes the following error meesage?
>
> TypeError: Result of expression 'canvas' [undefined] is not an object.
>
> My code is
>
> var canvas = document.getElementById('tutorial');
> var ctx = canvas.getContext('2d');
>
> The error is throwed in the second line.  But I have checked  IsObject(),
> the value is True,  IsUndefined(), the value is False.
>  Thanks a lot !
>
> It looks like that the function getElementById() doesnot return an invalid
> value. You'd better check the C++ definition of getElementById() to see if
> there is valid value returned.
>
> Cheers
>
> Xiaolei
>
>
> --
> Best regards
> Li Zhongmiao
> Digital Media, College of Computer Science, Zhejiang University
>
>
> _______________________________________________
> Qt-interest mailing listQt-interest at trolltech.comhttp://lists.trolltech.com/mailman/listinfo/qt-interest
>
>
>
> _______________________________________________
> Qt-interest mailing list
> Qt-interest at trolltech.com
> http://lists.trolltech.com/mailman/listinfo/qt-interest
>
>


-- 
Best regards
Li Zhongmiao
Digital Media, College of Computer Science, Zhejiang University
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20101213/3b8ef7bc/attachment.html 


More information about the Qt-interest-old mailing list