Command working in terminal, but not via QProcess

前端 未结 3 1959
一整个雨季
一整个雨季 2020-11-30 07:48
ifconfig | grep \'inet\'

is working when executed via terminal. But not via QProcess

My sample code is

QProcess p1;
p1.star         


        
3条回答
  •  甜味超标
    2020-11-30 08:29

    You can not use the pipe symbol in QProcess it seems.

    However there is the setStandardOutputProcess Method that will pipe the output to the next process.

    An example is provided in the API.

提交回复
热议问题