Results 1 to 7 of 7

Thread: Pipe multiple QProcess

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,376
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Thanks
    4
    Thanked 5,019 Times in 4,795 Posts
    Wiki edits
    10

    Default Re: Pipe multiple QProcess

    It's also very easy to implement a pipe based on QIODevice.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  2. #2
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    12
    Thanked 1 Time in 1 Post

    Default Re: Pipe multiple QProcess

    wysota, that's interesting. Reading briefly the QIODevice documentation it seems to me that such a pipe would be implemented sub-classing it, using a QByteArray to store writes and emitting readyReads, right?

    The only thing I do not understand is if it's possible to automatically attach a QProcess to multiple QIODevice, so that when one has data ready, they are copied to every other connected device... In other words, I do not see why it should be more convenient to use a QIODevice to pipe.

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

    Default Re: Pipe multiple QProcess

    Quote Originally Posted by akiross View Post
    wysota, that's interesting. Reading briefly the QIODevice documentation it seems to me that such a pipe would be implemented sub-classing it, using a QByteArray to store writes and emitting readyReads, right?
    Basically, yes.

    The only thing I do not understand is if it's possible to automatically attach a QProcess to multiple QIODevice
    You can implement a multiplexer device that reads from one source and writes to multiple destinations.

    In other words, I do not see why it should be more convenient to use a QIODevice to pipe.
    It would be more convenient because you retain the QIODevice API so you can use the pipe with anything that can read from QIODevice or write to QIODevice. Bear in mind QProcess, QFile, QAbstractSocket are all QIODevice subclasses.
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  4. #4
    Join Date
    Feb 2007
    Location
    Italy
    Posts
    69
    Qt products
    Qt4
    Platforms
    Unix/X11
    Thanks
    12
    Thanked 1 Time in 1 Post

    Default Re: Pipe multiple QProcess

    Well, my original post was mainly directed to the creation of the multiplexer itself, but it seems that I have to tailor a solution by myself.

    Thanks anyway, I will consider creating a QIODevice to pipe (and multiplex).

Similar Threads

  1. QProcess in main() opens multiple instances
    By gojkovicde in forum Newbie
    Replies: 2
    Last Post: 10th December 2012, 07:43
  2. Replies: 7
    Last Post: 13th September 2011, 13:15
  3. No process is on the other end of the pipe
    By Luc4 in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 7th March 2010, 00:26
  4. pipe in a QByteArray to a QProcess
    By Gravis in forum Qt Programming
    Replies: 1
    Last Post: 28th February 2010, 22:53
  5. QProcess Bash in Event Filter (Multiple Processes)
    By Arsenic in forum Qt Programming
    Replies: 1
    Last Post: 8th November 2008, 08:42

Tags for this Thread

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
  •  
Qt is a trademark of The Qt Company.