qt捕获cmd控制台标准输出(输入输出重定向)

来源:互联网 发布:java工程师项目经验 编辑:程序博客网 时间:2024/05/16 18:55

#include "mainwindow.h"
#include "ui_mainwindow.h"
#include"QProcess"
#include"QDebug"
#include"qdebug.h"


...........

QProcess p2(0);

   p2.start("SmartRFProgConsole X");
   p2.waitForStarted();

   p2.waitForFinished();

   QString strTemp=QString::fromLocal8Bit(p2.readAllStandardOutput());

   qDebug()<<strTemp;


....................................

0 0