hakermania
9th September 2011, 21:56
I am using QProcess to start an application with arguments defined in an QStringList.
Well, the program does quite some time to execute and during this time the program hangs.
I thought that Qt's functions was designed in such a way so as not to hang... (that's why I chose QProcess instead of system() anyway)
So, what I do is:
QString exec = "wget"; // <- making a variable, we will use 'exec' again, to download the image!
QStringList params1;
params1 << "-O" << "url" << "http://remote.location.com/remote_file";
check_url->start(exec, params1);
if(!check_url->waitForFinished()){
cerr << "Couldn't get file, possibly too slow internet connection (file size is 10 Kbytes)!\n";
delete check_url;
return false;
}
if(check_url->exitCode()){
cerr << "Something went wrong while downloading the file!\n";
delete check_url;
return false;
}
delete check_url;
And during this function the program hangs completely, is there any way qprocess not to append to the process it's attempting to run?
Well, the program does quite some time to execute and during this time the program hangs.
I thought that Qt's functions was designed in such a way so as not to hang... (that's why I chose QProcess instead of system() anyway)
So, what I do is:
QString exec = "wget"; // <- making a variable, we will use 'exec' again, to download the image!
QStringList params1;
params1 << "-O" << "url" << "http://remote.location.com/remote_file";
check_url->start(exec, params1);
if(!check_url->waitForFinished()){
cerr << "Couldn't get file, possibly too slow internet connection (file size is 10 Kbytes)!\n";
delete check_url;
return false;
}
if(check_url->exitCode()){
cerr << "Something went wrong while downloading the file!\n";
delete check_url;
return false;
}
delete check_url;
And during this function the program hangs completely, is there any way qprocess not to append to the process it's attempting to run?