+ Reply to Thread
Results 1 to 4 of 4

Thread: QProcess cross-communication

  1. #1
    Join Date
    Mar 2014
    Location
    USA
    Posts
    50
    Thanks
    11
    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
    50
    Thanks
    11
    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 15:01.

+ Reply to Thread

Similar Threads

  1. Replies: 1
    Last Post: 3rd June 2013, 13:11
  2. QProcess - communication
    By pixsta in forum Qt Programming
    Replies: 1
    Last Post: 22nd September 2011, 21:39
  3. Replies: 1
    Last Post: 11th November 2010, 00:31
  4. Replies: 0
    Last Post: 2nd August 2010, 09:17
  5. QProcess communication
    By bunjee in forum Qt Programming
    Replies: 9
    Last Post: 22nd January 2009, 13: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