You might try something like this:
connect( process,
SIGNAL( finished
( int,
QProcess::ExitStatus ) ), process,
SLOT( deleteLater
() ) );
process
->setArguments
( QStringList() <<
"konqueror" << url
);
if( process->waitForStarted() ) {
return true;
}
process
->setArguments
( QStringList() <<
"mozilla" << url
);
if( process->waitForStarted() ) {
return true;
}
delete process;
return false;
QProcess *process = new QProcess();
connect( process, SIGNAL( finished( int, QProcess::ExitStatus ) ), process, SLOT( deleteLater() ) );
process->setArguments( QStringList() << "konqueror" << url );
if( process->waitForStarted() ) {
return true;
}
process->setArguments( QStringList() << "mozilla" << url );
if( process->waitForStarted() ) {
return true;
}
delete process;
return false;
To copy to clipboard, switch view to plain text mode
But IMO it will be better if you implement a class, for example BrowserLauncher, that would use only non-blocking methods.
Check this: http://qds.berlios.de/services.html#Launcher
Bookmarks