Re: PyQt, Cannot send events to objects owned by a different thread?

2009-01-18 Thread icejobjob

AE•X‰ÍŠúA‚»‚ê‚à’´AE•X‰ÍŠú‚ÉŽ„‚½‚¿‚Í’¼–Ê‚µ‚Ä‚¢‚Ü‚·

‚±‚́A'AEŠˆ“®'
(http://www.pwblog.com/user/xru01/syusyoku/)‚Í•À‘å’ï‚Ì“w—͂ł͏æ‚èØ‚邱‚Æ‚ª¢“ï‚ÆŒ¾‚í‚ê‚Ä‚¢‚Ü‚·B

•Ä‘AƒAƒƒŠƒJ‚̃Tƒuƒvƒ‰ƒCƒ€‚ð”çØ‚è‚Ɉø‚«‹N‚±‚³‚ꂽ¡‰ñ‚Ì•s‹µA‚»‚ꂱ‚»””NŠÔ‚ɂ킽‚Á‚āA¢ŠEŒoÏ‚ɃCƒ“ƒpƒNƒg‚ð—^‚¦‘±‚¯‚é‚Å‚µ‚傤B

‚±‚ÌŽžŠú‚́A¡‚Ì‚*‚È‚½‚ª’¼–Ê‚µ‚Ä‚¢‚éAEŠˆ“®‚Æ‚¢‚¤ƒCƒxƒ“ƒg‚́A‚*‚È‚½‚̐l¶AAEl¶‚Ì‘å‚«‚ȃEƒGƒCƒg‚ðè‚߂邱‚Æ‚Æ‚È‚è‚Ü‚·B

AEŠˆ“®‚́A‹Zp‚Æ’mŽ¯‚ŏæ‚èØ‚邱‚Æ‚ªo—ˆ‚Ü‚·BAE•X‰ÍŠúAâ‘΂Ɍã‰÷‚µ‚È‚¢‚悤‚É‘S—͂Ő킢‚Ü‚µ‚傤B


-- 
icejobjob

icejobjob's Profile: http://forums.yourdomain.com.au/member.php?userid=5313
View this thread: http://forums.yourdomain.com.au/showthread.php?t=18594

--
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
David Boddie wrote:

> You can either construct some sort of event handling mechanism or use
> signals and slots. Personally, I'd use signals and slots for this, if
> possible.
> 
> The idea would be to set up a connection between your callback code and
> the status bar's showMessage() slot. Then you would only have to emit that
> signal to update the status bar.

hallo david,

great, the signal an slot mechanism works over threads, 

thanks
alex
-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread David Boddie
On Sun Nov 25 15:22:24 CET 2007, Alexander Tuchacek wrote:

> i try to adress an qt object 
> 
> self.statusbar.showMessage("rtt %s" % (n.rtt))
> 
> in an callback function, comming from a shared lib importet by ctypes, on
> osx this works wonderfull 
> 
> when i run the same code on linux (ubuntu gutsy), i get this core dump, ok,
> i understand that the problem is, that i cant speak to the qt thread, but
> why does it work on osx? 

Maybe the implementation of the library is different on OS X. You need to
give us more enough information to work with.

> shall i recompile python? pyqt or sip? without threads? 
> 
> could somebody give me a hint what to do best? how can i call a qt object in
> an c-lib callback?

You can either construct some sort of event handling mechanism or use signals
and slots. Personally, I'd use signals and slots for this, if possible.

The idea would be to set up a connection between your callback code and
the status bar's showMessage() slot. Then you would only have to emit that
signal to update the status bar.

David

-- 
http://mail.python.org/mailman/listinfo/python-list


Re: PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Bjoern Schliessmann
Alexander Tuchacek wrote:
> i try to adress an qt object
> 
> self.statusbar.showMessage("rtt %s" % (n.rtt))
> 
> in an callback function, comming from a shared lib importet by
> ctypes, on osx this works wonderfull
> 
> when i run the same code on linux (ubuntu gutsy), i get this core
> dump, ok, i understand that the problem is, that i cant speak to
> the qt thread, but why does it work on osx?

Luck. If something works reproducibly in some conditions, that
neither means it will work elsewhere nor that it is wise to do so
at all.

(I will spare the group far-fetched road traffic similes for
now ;) )

> shall i recompile python? pyqt or sip? without threads?
> 
> could somebody give me a hint what to do best? 

Just use Qt as recommended in its docs; that's how you do the best
you can against future portability or other issues.

Regards,


Björn

-- 
BOFH excuse #99:

SIMM crosstalk.

-- 
http://mail.python.org/mailman/listinfo/python-list


PyQt, Cannot send events to objects owned by a different thread?

2007-11-25 Thread Alexander Tuchacek
hallo,

i try to adress an qt object 

self.statusbar.showMessage("rtt %s" % (n.rtt))

in an callback function, comming from a shared lib importet by ctypes, on
osx this works wonderfull 

when i run the same code on linux (ubuntu gutsy), i get this core dump, ok,
i understand that the problem is, that i cant speak to the qt thread, but
why does it work on osx? 

shall i recompile python? pyqt or sip? without threads? 

could somebody give me a hint what to do best? how can i call a qt object in
an c-lib callback? 

thanks for any help,
alex

ASSERT failure in QCoreApplication::sendEvent: "Cannot send events to
objects owned by a different thread. Current thread 82c31e8.
Receiver 'MainWindow' (of type 'MainWindow') was created in thread
81f5060", file kernel/qcoreapplication.cpp, line 269
Aborted (core dumped)

-- 
http://mail.python.org/mailman/listinfo/python-list