| 115 | } |
| 116 | |
| 117 | void ProjectModelItemDelegate::drawBranchName(QPainter* painter, const QStyleOptionViewItem& option, |
| 118 | const QRect& rect, const QString& branchName) const |
| 119 | { |
| 120 | QString text = option.fontMetrics.elidedText(branchName, Qt::ElideRight, rect.width()); |
| 121 | |
| 122 | bool selected = option.state & QStyle::State_Selected; |
| 123 | QPalette::ColorGroup colorGroup = selected ? QPalette::Active : QPalette::Disabled; |
| 124 | painter->save(); |
| 125 | painter->setPen(option.palette.color(colorGroup, QPalette::Text)); |
| 126 | painter->drawText(rect, text); |
| 127 | painter->restore(); |
| 128 | } |
| 129 | |
| 130 | void ProjectModelItemDelegate::drawStyledBackground(QPainter* painter, const QStyleOptionViewItem& option) const |
| 131 | { |