- Initial implementation of Peer list

This commit is contained in:
Christophe Dumez
2009-11-14 10:37:45 +00:00
parent d8c6e2bcc6
commit 8260159ca4
11 changed files with 283 additions and 62 deletions

View File

@@ -65,7 +65,7 @@ public:
case DLSPEED:{
QItemDelegate::drawBackground(painter, opt, index);
double speed = index.data().toDouble();
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(speed/1024., 'f', 1))+QString::fromUtf8(" ")+tr("KiB/s"));
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(speed/1024., 'f', 1)+" "+tr("KiB/s"));
break;
}
case RATIO:{
@@ -74,7 +74,7 @@ public:
if(ratio > 100.)
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::fromUtf8(""));
else
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString(QByteArray::number(ratio, 'f', 1)));
QItemDelegate::drawDisplay(painter, opt, opt.rect, QString::number(ratio, 'f', 1));
break;
}
case PRIORITY: {
@@ -91,7 +91,7 @@ public:
QStyleOptionProgressBarV2 newopt;
double progress = index.data().toDouble()*100.;
newopt.rect = opt.rect;
newopt.text = QString(QByteArray::number(progress, 'f', 1))+QString::fromUtf8("%");
newopt.text = QString::number(progress, 'f', 1)+"%";
newopt.progress = (int)progress;
newopt.maximum = 100;
newopt.minimum = 0;