I'm having problem getting output of this simple program in the console in w2k. In Linux, no problem, I get the expected lines. Can anyone find a problem with this? Why isn't there any output?
I'm having problem getting output of this simple program in the console in w2k. In Linux, no problem, I get the expected lines. Can anyone find a problem with this? Why isn't there any output?
Add "CONFIG += console" to your .pro file.
Morea (26th February 2006)
No need to create a QApplication or QCoreApplication?
Last edited by Morea; 26th February 2006 at 23:13.
No. The console is independent of Qt.
Morea (26th February 2006)
Thank you all! Your patience with all my problems is incredible.![]()
I have a similar program(see below), and I do add "config += console" for qmake. but I can only get the first output but not the second output. Does anyone can help me?
Mingw 3.4.5 + Windows Vista Home
Qt Code:
#include <QProcess> #include <QString> #include <QByteArray> #include <QTextStream> #include <QDebug> int main(int argc, char** argv){ out<<"[result]"<<endl<<flush; qDebug()<<"debug output"<<endl; QProcess* p; p->start("dir"); if (!p->waitForFinished()) return -1; QByteArray b; b=p->readAll(); out<<QString(b)<<endl; qDebug()<<QString(b); out<<"[end]"<<endl; qDebug()<<"debug end"; return 0; }To copy to clipboard, switch view to plain text mode
Last edited by jacek; 1st November 2007 at 21:11. Reason: missing [code] tags
Bookmarks