
qBittorrent v3.1.0, latest alpha build.
Resized a bit, original resolution 1920x1080. Still loading some torrents

Code: Select all
case TorrentModelItem::TR_PROGRESS:{
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
// We don't want to display 100% unless
// the torrent is really complete
if (progress > 99.94 && progress < 100.)
progress = 99.9;
newopt.rect = opt.rect;
newopt.text = QString::number(progress, 'f', 1)+"%";
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
#ifndef Q_WS_WIN
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
#else
// XXX: To avoid having the progress text on the right of the bar
QPlastiqueStyle st;
st.drawControl(QStyle::CE_ProgressBar, &newopt, painter, 0);
#endif
break;
Code: Select all
case TorrentModelItem::TR_PROGRESS:{
QStyleOptionProgressBarV2 newopt;
qreal progress = index.data().toDouble()*100.;
// We don't want to display 100% unless
// the torrent is really complete
if (progress > 99.94 && progress < 100.)
progress = 99.9;
newopt.rect = opt.rect;
newopt.text = QString::number(progress, 'f', 1)+"%";
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;
newopt.state |= QStyle::State_Enabled;
newopt.textVisible = true;
newopt.textAlignment = Qt::AlignCenter;
QApplication::style()->drawControl(QStyle::CE_ProgressBar, &newopt, painter);
break;