I am developing an application to Download file from NFS Server to my pc. To accomplish my task i wrote a Shell script to copy all the directories at given path and executing the script using QProcess. QProcess works fine and downloads all the directories.
Now, I want to show the downloading process report on QProgressBar. (same as we see on our windows while downloading files from internet).
I tried google search and find some idea using signal and tried as follow:
void NfsClient::NfsDownload()
{
download = new QProcess(this);
connect(download, SIGNAL(readyReadStandardOutput()), this, SLOT(displayProgressBar()) );
download->execute("bash /home/samurai/NfsFileDownload.sh");
}
void NfsClient::displayProgressBar()
{
ui->progressbar->setvalue(download->readAll().toInt());
}
But this readyReadStandardOutput() signal is never emitted. My Qt window becomes freeze while executing script. And Progressbar remains unchanged. :(
Is there any way to update the QProgressbar accordingly??? or any idea to show the GUI view of downloading process???
any suggestions/ideas ???