Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to realize the function of Inter-process Dialogue in qt

2025-03-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains "qt how to achieve inter-process dialogue function", the content of the article is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "qt how to achieve inter-process dialogue function" bar!

Sample code

The code on the called side is exactly the same as in yesterday's article, and only the code on the calling side is described here.

# include

# include

# include

Int main (int argc, char * argv [])

{

QCoreApplication a (argc, argv)

QProcess server

Server.start ("G:\\ Qt\\ 21070809 ProcessComm\\ ServerProcess\\ bin\\ debug\\ ServerProcess.exe"

, QStringList (); if (! server.waitForStarted ())

Return-1; QTextStream cin (stdin)

QTextStream cout (stdout)

QByteArray input

QByteArray response

While (input! = "bye\ n")

{

Cin > > input

Input + = "\ n"

Server.write (input)

Server.waitForReadyRead ()

Response = server.readLine ()

Response.replace ("\ r\ n", "")

Cout

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report