How to run a system command in Qt?

前端 未结 2 1679
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-24 01:50

I have to run a system command in Qt. but I have to give an argument for that command.

for example opening gedit with a text file. like \"gedit /home/oDx/Documents/

2条回答
  •  天命终不由人
    2020-12-24 02:24

    QProcess process;
    process.start("gedit", QStringList() << docPath);
    

    the same as above

    QProcess process;
    process.start("gedit", QStringList() << "/home/oDx/Documents/a.txt");
    

    Also, read this.

提交回复
热议问题