I have tried these ones:
m_process->setCommunication( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr);
m_process->start()
while(m_process->canReadLineStdout() )
qDebug()<<m_process->readLineStdout();
m_process->setCommunication( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr);
m_process->start()
while(m_process->canReadLineStdout() )
qDebug()<<m_process->readLineStdout();
To copy to clipboard, switch view to plain text mode
connect( m_process, SIGNAL(readyReadStdout()), this, SLOT(readStandardOutput()) )
m_process->setCommunication( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr);
m_process->start();
....
qDebug()<<m_process-> readStdout() [in readStandardOutput() slot]
connect( m_process, SIGNAL(readyReadStdout()), this, SLOT(readStandardOutput()) )
m_process->setCommunication( Q3Process::Stdin | Q3Process::Stdout | Q3Process::Stderr | Q3Process::DupStderr);
m_process->start();
....
qDebug()<<m_process-> readStdout() [in readStandardOutput() slot]
To copy to clipboard, switch view to plain text mode
m_process
->setProcessChannelMode
(QProcess::MergedChannels);
connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
startProcess(m_progname);
...
qDebug()<<
QString(m_process
->readAllStandardError
());
[readStandardError
() slot] ...
qDebug()<<
QString(m_process
->readAllStandardOutput
());
[readStandardOutput
() slot] ...
[as I said if I close write channel in readStandardError() slot, I will get those lines ]
m_process = new QProcess(this);
m_process->setProcessChannelMode(QProcess::MergedChannels);
connect(m_process, SIGNAL(readyReadStandardError()), this, SLOT(readStandardError()));
connect(m_process, SIGNAL(readyReadStandardOutput()), this, SLOT(readStandardOutput()));
startProcess(m_progname);
...
qDebug()<< QString(m_process->readAllStandardError()); [readStandardError() slot]
...
qDebug()<< QString(m_process->readAllStandardOutput()); [readStandardOutput() slot]
...
[as I said if I close write channel in readStandardError() slot, I will get those lines ]
To copy to clipboard, switch view to plain text mode
I even tried to redirect outputs to files, but again no success in getting those lines before stdin prompt. Am I doing something wrong?
I have reviewed some codes of others (both qt3 and qt4) especially codes of IDEs but no success. I would be happy even if you point me some where (code, thread..) to learn more.
I tried Google and Koders, but no success again.
Besides, is there any non-qt work-around for this problem? Do you know some pure C++ console like code, which is wrapped in qt?
Bookmarks