+ QRectF bounding;
+ painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText, &bounding);
+
+ int proxy = index.data(Qt::UserRole + 5).toInt();
+ if (proxy != 0 && proxy != JOBDONE) {
+ QString proxyText;
+ QColor color;
+ if (proxy != JOBCRASHED) {
+ // Draw proxy progress bar
+ color = option.palette.alternateBase().color();
+ painter->setPen(Qt::NoPen);
+ color.setAlpha(180);
+ painter->setBrush(QBrush(color));
+ QRect progress(pixmapPoint.x() + 1, pixmapPoint.y() + pixmap.height() - 5, pixmap.width() - 2, 4);
+ painter->drawRect(progress);
+ painter->setBrush(option.palette.text());
+ if (proxy > 0) {
+ progress.adjust(1, 1, 0, -1);
+ progress.setWidth((pixmap.width() - 4) * proxy / 100);
+ painter->drawRect(progress);
+ }
+ else if (proxy == JOBWAITING) {
+ // Draw kind of a pause icon
+ progress.adjust(1, 1, 0, -1);
+ progress.setWidth(2);
+ painter->drawRect(progress);
+ progress.moveLeft(progress.right() + 2);
+ painter->drawRect(progress);
+ }
+ }
+ else if (proxy == JOBCRASHED) {
+ proxyText = i18n("Proxy crashed");
+ QRectF txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " ");
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(option.palette.highlight());
+ painter->drawRoundedRect(txtBounding, 2, 2);
+ painter->setPen(option.palette.highlightedText().color());
+ painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , proxyText);
+ }
+ }
+