[Qt-interest] QObject used from outside its own thread

Zhongmiao Li mars.leezm at gmail.com
Wed Dec 15 21:31:29 CET 2010


Hi Thank, your hint and the document help a lot, it's almost working well.

But I met a problem

QObject used from outside its own thread,
object=nemo::multitouch::webkit::Context2D(0x18b12be0) ,
objectThread=Thread[main,5,main], currentThread=Thread[Smack Listener
Processor (0),5,main]

Because in my program, I send a packet and when the respond is
received, I will call a function in the script. So is there any method
to avoid this exception?


On 12/14/10, noam.rosenthal at nokia.com <noam.rosenthal at nokia.com> wrote:
>>-----Original Message-----
>>From: ext Joshua Lee [mailto:muzili at gmail.com]
>>Sent: Tuesday, December 14, 2010 7:56 PM
>>To: Rosenthal Noam (Nokia-MS-Qt/RedwoodCity)
>>Cc: mars.leezm at gmail.com; qt-interest at trolltech.com
>>Subject: Re: [Qt-interest] Invoke function in JavaScript
>>
>>Hi No'am,
>>I want pass C++ value to javascript function 'foobar',
>>how to get it?
>>
> You convert it into a QScriptValue, e.g. by wrapping it in a QVariant
> (http://doc.trolltech.com/4.7/qscriptengine.html#newVariant)
>
> I suggest some light reading: http://doc.trolltech.com/4.7/scripting.html
> It's all there :)
>
> No'am
>


-- 
Best regards
Li Zhongmiao
Digital Media, College of Computer Science, Zhejiang University



More information about the Qt-interest-old mailing list