调用exe-2

 

  

 

 1 void CallExe::on_pushButton_clicked()
 2 {
 3     QProcess *process=new QProcess(this);
 4     connect(process, &QProcess::readyReadStandardOutput,
 5         [=]
 6     {
 7         QString str=process->readAllStandardOutput();
 8         ui.label->setText(str);
 9     });
10     
11     //out.exe    每秒输出一个数字到控制台。现在将值输出到label上
12     process->start("../../out/Win32/Debug/out.exe");
13 }

 

posted @ 2019-02-13 21:57  雪落梅藏  阅读(98)  评论(0编辑  收藏  举报