代码

话不多直接上本人代码

void MainWindow::on_pushButton_3_clicked()
{
    myprocess = new QProcess(this);
    myprocess->start("pwd");

    myprocess->waitForFinished();
    QString abc = myprocess->readAllStandardOutput();
    QLibX::QMessageBoxEx::GetInstance()->information(this,"Title",abc);
}

外加一个引用

http://stackoverflow.com/questions/11921004/cannot-read-output-using-readyreadstandardoutput-in-qt

效果

 

Qt 获得终端执行结果

相关文章:

  • 2022-02-11
  • 2021-09-04
  • 2022-12-23
  • 2021-07-13
  • 2022-12-23
  • 2021-09-13
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-08-28
  • 2021-06-25
  • 2022-12-23
  • 2021-12-21
  • 2021-08-10
相关资源
相似解决方案