+ QRectF bounding;
+ painter->drawText(r2, Qt::AlignLeft | Qt::AlignVCenter , subText, &bounding);
+
+ int proxy = index.data(Qt::UserRole + 5).toInt();
+ if (proxy != 0) {
+ QRectF txtBounding;
+ QString proxyText;
+ QBrush brush;
+ QColor color;
+ if (proxy > 0) {
+ proxyText = i18n("Proxy %1\%", proxy);
+ brush = option.palette.highlight();
+ color = option.palette.color(QPalette::HighlightedText);
+
+ }
+ else if (proxy == PROXYDONE) {
+ proxyText = i18n("Proxy");
+ brush = option.palette.mid();
+ color = option.palette.color(QPalette::WindowText);
+ }
+ else {
+ switch (proxy) {
+ case CREATINGPROXY:
+ proxyText = i18n("Generating proxy ...");
+ break;
+ case PROXYWAITING:
+ proxyText = i18n("Waiting proxy ...");
+ break;
+ case PROXYCRASHED:
+ default:
+ proxyText = i18n("Proxy crashed");
+ }
+ brush = option.palette.highlight();
+ color = option.palette.color(QPalette::HighlightedText);
+ }
+
+ txtBounding = painter->boundingRect(r2, Qt::AlignRight | Qt::AlignVCenter, " " + proxyText + " ");
+ painter->setPen(Qt::NoPen);
+ painter->setBrush(brush);
+ painter->drawRoundedRect(txtBounding, 2, 2);
+ painter->setPen(option.palette.highlightedText().color());
+ painter->drawText(txtBounding, Qt::AlignHCenter | Qt::AlignVCenter , proxyText);
+ }
+