Qt - QProcess不工作 [英] Qt - QProcess is not working
本文介绍了Qt - QProcess不工作的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我尝试启动互联网浏览器,所以我使用下面的代码
I try to launch internet explorer, So I use the below code
QProcess * process=new QProcess(this);
QString temp="C:\\Program Files\\Internet\ Explorer\\iexplore.exe";
process->startDetached(temp.toStdString().c_str());
但它不工作。请帮助我。
But it not works. Please help me?
推荐答案
尝试:
QProcess * process=new QProcess(this);
QString temp="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"";
process->startDetached(temp);
您需要使用转义引号,因为路径中有空格,或者可能转义所有空格(您错过了 Program\ Files
在您发布的代码)。
You need to use escaped quotes since the path has a space in it, or possibly escape all the spaces (you missed Program\ Files
in the code you posted).
这篇关于Qt - QProcess不工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文