Nyphel
5th April 2007, 16:10
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++;
}
The A application detects that data is ready read, and display it :
QString message = "";
message.append(myProcess->readAllStandardOutput());
std::cout << "." << message.toStdString() << "." << std::endl;
And the message is :
.0
1
2
3
4
5
6
7
8
9.
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++;
}
And the message would be :
.0.
I could have 10 messages, and not just one.
Have you got an idea ?
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++;
}
The A application detects that data is ready read, and display it :
QString message = "";
message.append(myProcess->readAllStandardOutput());
std::cout << "." << message.toStdString() << "." << std::endl;
And the message is :
.0
1
2
3
4
5
6
7
8
9.
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++;
}
And the message would be :
.0.
I could have 10 messages, and not just one.
Have you got an idea ?