| 112 | } |
| 113 | |
| 114 | void TaskDelegate::paint(QPainter *painter, const QStyleOptionViewItem &option, const QModelIndex &index) const |
| 115 | { |
| 116 | if (!index.isValid()) |
| 117 | return DStyledItemDelegate::paint(painter, option, index); |
| 118 | |
| 119 | painter->setRenderHints(painter->renderHints() |
| 120 | | QPainter::Antialiasing |
| 121 | | QPainter::TextAntialiasing |
| 122 | | QPainter::SmoothPixmapTransform); |
| 123 | |
| 124 | QStyleOptionViewItem opt = option; |
| 125 | initStyleOption(&opt, index); |
| 126 | opt.rect.adjust(8, 0, -8, 0); |
| 127 | paintItemBackground(painter, opt, index); |
| 128 | painter->setOpacity(1); |
| 129 | |
| 130 | QIcon icon = index.data(TaskModel::Icon).value<QIcon>(); |
| 131 | QRect icRect = iconRect(opt.rect); |
| 132 | painter->drawPixmap(icRect, icon.pixmap(kTaskIconSize, kTaskIconSize)); |
| 133 | paintItemColumn(painter, opt, index, icRect); |
| 134 | } |
| 135 | |
| 136 | void TaskDelegate::paintItemBackground(QPainter *painter, const QStyleOptionViewItem &option, |
| 137 | const QModelIndex &index) const |
nothing calls this directly
no test coverage detected