| 57 | } |
| 58 | |
| 59 | QSize ItemDelegate::sizeHint(const QStyleOptionViewItem &option, |
| 60 | const QModelIndex &index) const |
| 61 | { |
| 62 | if (index.isValid()) { |
| 63 | QSize size = index.data(Qt::SizeHintRole).toSize(); |
| 64 | if (size.isValid()) { |
| 65 | return size; |
| 66 | } else { |
| 67 | return { option.rect.width(), option.fontMetrics.height() * 2 + 5 }; |
| 68 | } |
| 69 | } |
| 70 | return DStyledItemDelegate::sizeHint(option, index); |
| 71 | } |
| 72 | |
| 73 | void ItemDelegate::paintItemBackground(QPainter *painter, const QStyleOptionViewItem &option, |
| 74 | const QModelIndex &index) const |
no test coverage detected