What is the best way to show in progress bar the progress of file upload?
I need to visualize in progress bar the status of file being uploaded to server .
How do I do the calculations on this ?
What do you mean? What are you using for upload?
It depends on the classes you use for uploading your data. You might want to look into the "QNetworkReply::uploadProgress() ":http://doc.qt.nokia.com/4.7/qnetworkreply.html#uploadProgress signal and connect it to the progressbar.
If you use a file you might want to use this:
sendProgress->setValue( (fileToSend->pos() * 100) / fileToSend->size());
The pos() functions comes from the QIODevice class, but it is inherited by QFile.