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

Discussion in 'Python' started by Alexander Tuchacek, Nov 25, 2007.

  1. 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)
    Alexander Tuchacek, Nov 25, 2007
    #1
    1. Advertising

  2. 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.
    Bjoern Schliessmann, Nov 25, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. tolu45
    Replies:
    4
    Views:
    4,504
    Roedy Green
    Mar 29, 2006
  2. Joost Ronkes Agerbeek

    auto_ptr: reassigning to member of owned object

    Joost Ronkes Agerbeek, Oct 2, 2003, in forum: C++
    Replies:
    2
    Views:
    474
    Joost Ronkes Agerbeek
    Oct 3, 2003
  3. NaeiKinDus
    Replies:
    1
    Views:
    558
    Jack Klein
    Apr 14, 2007
  4. NaeiKinDus
    Replies:
    3
    Views:
    588
    James Kanze
    Apr 15, 2007
  5. David Boddie
    Replies:
    1
    Views:
    1,097
    Alexander Tuchacek
    Nov 25, 2007
Loading...

Share This Page