why it is there in the readFromStdout()...[here i get the process' o/p and put it in a TextEdit] and also the InputLineEdit->displayText()..[here i get the i/p from the lineedit and give it to the writeToStdin()]
1.
2.
proc->setCommunication
( QProcess::Stdin |QProcess
::Stdout|QProcess
::Stderr|QProcess
:big grin upStderr
);
3.
proc->addArgument( "./a.out" );
4.
connect( proc, SIGNAL(readyReadStdout()),this, SLOT([B][U]readFromStdout()[/U][/B]) );
5.
6.
if ( !proc->start() ) {
7.
}
8.
if(proc->isRunning()) {
9.
proc->[B][U]writeToStdin(InputLineEdit->displayText());[/U][/B]
10.
}
11.
12.
void MainForm::readFromStdout()
13.
{
14.
while(proc->canReadLineStdout()) {
15.
[B][U] OutputEdit->append( proc->readLineStdout() +'\n');[/U][/B]
16.
}
17.
}
1.
proc = new QProcess( this );
2.
proc->setCommunication( QProcess::Stdin |QProcess::Stdout|QProcess::Stderr|QProcess:big grin upStderr );
3.
proc->addArgument( "./a.out" );
4.
connect( proc, SIGNAL(readyReadStdout()),this, SLOT([B][U]readFromStdout()[/U][/B]) );
5.
6.
if ( !proc->start() ) {
7.
}
8.
if(proc->isRunning()) {
9.
proc->[B][U]writeToStdin(InputLineEdit->displayText());[/U][/B]
10.
}
11.
12.
void MainForm::readFromStdout()
13.
{
14.
while(proc->canReadLineStdout()) {
15.
[B][U] OutputEdit->append( proc->readLineStdout() +'\n');[/U][/B]
16.
}
17.
}
To copy to clipboard, switch view to plain text mode
Bookmarks