Hello
I've two application A and B.
The first one - A - creates a QProcess in order to call the second one - B -.
The first one - A - listen the second one - B -, using readyRead() signal.
So, our B application send data to A in a loop :
int i = 0;
while (i<10)
{
std::cout << i << std::endl;
i++;
}
int i = 0;
while (i<10)
{
std::cout << i << std::endl;
i++;
}
To copy to clipboard, switch view to plain text mode
The A application detects that data is ready read, and display it :
message.append(myProcess->readAllStandardOutput());
std::cout << "." << message.toStdString() << "." << std::endl;
QString message = "";
message.append(myProcess->readAllStandardOutput());
std::cout << "." << message.toStdString() << "." << std::endl;
To copy to clipboard, switch view to plain text mode
And the message is :
I need to control the message content, in order to use correctly
So, it woul be nice if I could enforce the cout to be written immediately in the B application... Or enforce the A application to not append all the cout content.
Example :
int i = 0;
while (i<10)
{
std::cout << i << std::endl; // Enforce this to be submitted immediately
i++;
}
int i = 0;
while (i<10)
{
std::cout << i << std::endl; // Enforce this to be submitted immediately
i++;
}
To copy to clipboard, switch view to plain text mode
And the message would be :
I could have 10 messages, and not just one.
Have you got an idea ?
Bookmarks