Results 1 to 5 of 5

Thread: interprocess communication question

  1. #1
    Join Date
    Aug 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default interprocess communication question

    Dear folks,

    I invoke python gui (PyQt) application (child) process from another (parent) process. After invocation, qt some time, parent process sends some information to this gui application (child process) by writing this information to stdin port of child process.

    On gui application side, it needs to read 'its' stdin port and react to it.

    What is the best way for qui application to read its stdin port, and where/when, in gui code, should it do so?

    Any pointer to doc or an example will be very helpfull.

    best regards,

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: interprocess communication question

    There is no "best way"... You can use a QFile object that is assigned to STDIN to do that (it'll tell you whether there is actually anything to read). Where? Hmm... in some slot, probably, but it really depends what the application does and how it is constructed.

  3. #3
    Join Date
    Feb 2007
    Posts
    34
    Thanked 2 Times in 2 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: interprocess communication question

    Hi,

    Assuming python provides you full access to the qt classes and you use the QProcess class (http://doc.trolltech.com/4.3/qprocess.html). This class provides interfaces for communicating back and forth to the child process . It takes a bit of play to get familiar with it but it does work.

    -joe

  4. The following user says thank you to croftj for this useful post:

    samirg (30th August 2007)

  5. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: interprocess communication question

    I think the thread author asks for the other side - how to read stdin "the Qt way" from within the child.

  6. #5
    Join Date
    Aug 2007
    Posts
    9
    Thanks
    3
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default Re: interprocess communication question

    Thanks for all information on this question. I ended up using QSocketNotifier on stdin port
    of the child process. In my case, parent process is a LISP-based vendor platform which
    invokes child process written using PyQt.

    thanks,

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.