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

Discussion in 'Python' started by David Boddie, Nov 25, 2007.

  1. David Boddie

    David Boddie Guest

    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
     
    David Boddie, Nov 25, 2007
    #1
    1. Advertising

  2. 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
     
    Alexander Tuchacek, 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,563
    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:
    486
    Joost Ronkes Agerbeek
    Oct 3, 2003
  3. NaeiKinDus
    Replies:
    1
    Views:
    578
    Jack Klein
    Apr 14, 2007
  4. NaeiKinDus
    Replies:
    3
    Views:
    612
    James Kanze
    Apr 15, 2007
  5. Alexander Tuchacek
    Replies:
    1
    Views:
    989
    Bjoern Schliessmann
    Nov 25, 2007
Loading...

Share This Page