1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
| QProcess process; QString cmd;
QString dir = curEditor->fileInfo->absolutePath()+"/"+curEditor->fileInfo->baseName()+".exe"; cmd = "g++ -o "+dir+" " + curEditor->file->fileName();
process.start(cmd); process.waitForFinished(); process.waitForReadyRead(); QByteArray qba = process.readAllStandardError();
QTextCodec * pTextCodec = QTextCodec::codecForName("System");
QString str = pTextCodec->toUnicode(qba);
compilationInfoContainer->setPlainText(str);
|