Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Qt - QProcess is not working

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 doesn't work.

like image 795
prabhakaran Avatar asked Sep 05 '25 03:09

prabhakaran


1 Answers

Try:

QProcess * process=new QProcess(this);
QString temp="\"C:\\Program Files\\Internet Explorer\\iexplore.exe\"";
process->startDetached(temp);

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).

like image 133
Adam W Avatar answered Sep 07 '25 20:09

Adam W