I use a QProgressBar
to show the progress of a download operation. I would like to add some text to the percentage displayed, something like:
10% (download speed kB/s)
Any idea?
make the QProgressBar text visible.
QProgressBar *progBar = new QProgressBar();
progBar->setTextVisible(true);
to show the download progress
void Widget::setProgress(int downloadedSize, int totalSize)
{
double downloaded_Size = (double)downloadedSize;
double total_Size = (double)totalSize;
double progress = (downloaded_Size/total_Size) * 100;
progBar->setValue(progress);
// ******************************************************************
progBar->setFormat("Your text here. "+QString::number(progress)+"%");
}