Results 1 to 4 of 4

Thread: QProcess cross-communication

  1. #1
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default QProcess cross-communication

    If I have a program that starts another QProcess, can I get them to talk to each other? What I'm trying right now is: 1) QProcess *proc = new QProcess(this); 2)proc->start(program name, QStringList); I'm trying to connect signals and slots between the two but not having any luck. If that can't be done, does anybody have any suggestions on how I can pass information between the two? Even if it's a QString or QByteArray being sent/received I can work with it.

  2. #2
    Join Date
    Jun 2012
    Posts
    41
    Thanks
    4
    Thanked 1 Time in 1 Post
    Qt products
    Qt4 Qt/Embedded Qt Jambi
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Thumbs up Re: QProcess cross-communication

    Hi, TonyInSoMD.
    See if this small, compressed project at the bottom of the page can help.

    "http://www.qtcentre.org/threads/67606-Call-function-of-object-within-Threads?highlight=marcos.miranda"

    Remember at the bottom of the page.

    Cheers,

  3. #3
    Join Date
    Mar 2014
    Location
    USA
    Posts
    85
    Thanks
    17
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QProcess cross-communication

    Thanks for the try, but that is for a thread. It won't work for a process. I need something that will run between two processes, not a thread and its parent.

  4. #4
    Join Date
    Jun 2018
    Posts
    12
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: QProcess cross-communication

    Had the same problem, download the project marcos.miranda had. I found had that you need a fifth argument when you use the function connect. I think it is because your QProcess run on the different thread than your GUI, they wont communicate if you don't make the connect through multiple thread. Here's the solution for my QProcess program :
    connect(program,SIGNAL(readyReadStandardOutput()), this,SLOT(updateInfo()),Qt::DirectConnection);

    Hope this will help more people

    And for your post, if you still have the question. You only need 1 QProcess and the other program to write on a channel (i.e lineEdit) to communicate between both
    Last edited by superpomax; 11th June 2018 at 16:01.

Similar Threads

  1. Replies: 1
    Last Post: 3rd June 2013, 14:11
  2. QProcess - communication
    By pixsta in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2011, 22:39
  3. Replies: 1
    Last Post: 11th November 2010, 01:31
  4. Replies: 0
    Last Post: 2nd August 2010, 10:17
  5. QProcess communication
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 22nd January 2009, 14:52

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.