Important: Please read the Qt Code of Conduct -

QProcess Example

  • As I am still a complete novice, I would like to ask whether somebody is able to point me to example source code of a program that I can access with QProcess in my application. So, I would like source code of both sides of the inter-process communication story, showing at least synchronous and asynchronous exchanges and with/without replies. If you have example code that shows one or more of these things, please let me know.

  • @ModelTech

    For communication between applications the network examples come to mind. You could use QProcess to start the other program, if you really like.

    Otherwise your request is quite specific and I do not believe that you have much chances to get an example like that. In general interprocess communication is more diverse than simply packing into some example application. The networking stuff is for sure a way for communication you can use between processes. Otherwise there are also possibilities to use QSharedMemory or eventually QLocalSocket

  • Thanks for the hint. I will look into those examples. A more generic question is now however: must the process that I start with QProcess interact through TCP/IP?

  • @ModelTech

    No. You are completely free to make your choice. You can use cout and teh pipes provided by QProcess or any other mean. Some examples are already given. For a starter I would not choose anything too elaborate, because the more complex things are the more one get confused.

Log in to reply