| 40 | } |
| 41 | |
| 42 | void ProjectItemDelegate::paint(QPainter *painter, |
| 43 | const QStyleOptionViewItem &option, |
| 44 | const QModelIndex &index) const |
| 45 | { |
| 46 | if (!index.isValid()) |
| 47 | return DStyledItemDelegate::paint(painter, option, index); |
| 48 | |
| 49 | QStyleOptionViewItem opt = option; |
| 50 | DStyledItemDelegate::initStyleOption(&opt, index); |
| 51 | |
| 52 | opt.rect.adjust(10, 0, -10, 0); |
| 53 | painter->setRenderHint(QPainter::Antialiasing); |
| 54 | drawBackground(painter, opt); |
| 55 | int depth = itemDepth(index); |
| 56 | const auto &iconRect = drawFileIcon(depth, painter, opt, index); |
| 57 | drawFileNameItem(painter, opt, index, iconRect); |
| 58 | } |
| 59 | |
| 60 | QSize ProjectItemDelegate::sizeHint(const QStyleOptionViewItem &option, |
| 61 | const QModelIndex &index) const |