fyanardi
7th May 2006, 08:26
Hi all,
I'm new in this forum, and also new to Qt4. I have a problem with the new QProgess in Qt4. I need to start an application (a browser) from my application and I have successfully done that in Qt 3 using something similar to this:
QProcess process;
process.setArguments(QStringList() << "mozilla" << url);
if(process.start())
return true;
else
{
process.setArguments(QStringList() << "konqueror" << url);
if (process.start())
return true;
}
return false;
For Qt 4 version, I tried to change
if (process.start()) with
if (QProcess::startDetached("mozilla", QStringList() << url)) return true;
But QProcess::startDetached always returns true even though I dont have mozilla executable (even if I change "mozilla" to "asdf", it still returns true) :confused: .
I tried to use QProcess::start() and QProcess::waitForFinished() but seems that it just makes my application freezing even though the browser was successfully started :( .
Any suggestions? Thanks for your help ;)
I'm new in this forum, and also new to Qt4. I have a problem with the new QProgess in Qt4. I need to start an application (a browser) from my application and I have successfully done that in Qt 3 using something similar to this:
QProcess process;
process.setArguments(QStringList() << "mozilla" << url);
if(process.start())
return true;
else
{
process.setArguments(QStringList() << "konqueror" << url);
if (process.start())
return true;
}
return false;
For Qt 4 version, I tried to change
if (process.start()) with
if (QProcess::startDetached("mozilla", QStringList() << url)) return true;
But QProcess::startDetached always returns true even though I dont have mozilla executable (even if I change "mozilla" to "asdf", it still returns true) :confused: .
I tried to use QProcess::start() and QProcess::waitForFinished() but seems that it just makes my application freezing even though the browser was successfully started :( .
Any suggestions? Thanks for your help ;)