cic
10th November 2011, 10:13
im currently working with qt and have linked an external program to my qt project.
I want to display the output of my external program on compile output area as well.
so the code is as follow. After QT finished compiling, I run the project, and from compile area i can see it goes to "zou can see from the debug area....."
while the qt program just crashed, with warning : .....exited with code -1073741819
void myProject::Project(){
QObject *parent= 0;
QProcess *myProcess = new QProcess (parent);
connect(myProcess, SIGNAL(finished(int)), SLOT(playPause()));
qDebug() << connect(myProcess, SIGNAL(readyReadStandardError()), this, SLOT(updateError()));
qDebug() << connect(myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(updateText()));
myProcess->start("./sampledata/externalprogram.exe")
qDebug()<< "you can see from the debug area how he is running.";
}
void myProject::updateError(){
QByteArray data = myProcess->readAllStandardError();
qDebug()<< data;
}
void myProject::updateText(){
QByteArray data = myProcess->readAllStandardOutput();
qDebug()<< data;
}
anybody help ?
I want to display the output of my external program on compile output area as well.
so the code is as follow. After QT finished compiling, I run the project, and from compile area i can see it goes to "zou can see from the debug area....."
while the qt program just crashed, with warning : .....exited with code -1073741819
void myProject::Project(){
QObject *parent= 0;
QProcess *myProcess = new QProcess (parent);
connect(myProcess, SIGNAL(finished(int)), SLOT(playPause()));
qDebug() << connect(myProcess, SIGNAL(readyReadStandardError()), this, SLOT(updateError()));
qDebug() << connect(myProcess, SIGNAL(readyReadStandardOutput()), this, SLOT(updateText()));
myProcess->start("./sampledata/externalprogram.exe")
qDebug()<< "you can see from the debug area how he is running.";
}
void myProject::updateError(){
QByteArray data = myProcess->readAllStandardError();
qDebug()<< data;
}
void myProject::updateText(){
QByteArray data = myProcess->readAllStandardOutput();
qDebug()<< data;
}
anybody help ?