| 1334 | } |
| 1335 | |
| 1336 | bool RichTextViewDelegate::editorEvent(QEvent *event, QAbstractItemModel *model, |
| 1337 | const QStyleOptionViewItem &option, const QModelIndex &index) |
| 1338 | { |
| 1339 | if(event->type() == QEvent::MouseButtonRelease && index.isValid()) |
| 1340 | { |
| 1341 | QVariant v = index.data(); |
| 1342 | |
| 1343 | if(RichResourceTextCheck(v)) |
| 1344 | { |
| 1345 | QRect rect = option.rect; |
| 1346 | |
| 1347 | QIcon icon = index.data(Qt::DecorationRole).value<QIcon>(); |
| 1348 | |
| 1349 | if(!icon.isNull()) |
| 1350 | { |
| 1351 | rect.setX(rect.x() + |
| 1352 | icon.actualSize(option.decorationSize, QIcon::Normal, QIcon::On).width() + 4); |
| 1353 | } |
| 1354 | |
| 1355 | // ignore the return value, we always consume clicks on this cell |
| 1356 | RichResourceTextMouseEvent(m_widget, v, rect, option.font, (QMouseEvent *)event); |
| 1357 | return true; |
| 1358 | } |
| 1359 | } |
| 1360 | |
| 1361 | return ForwardingDelegate::editorEvent(event, model, option, index); |
| 1362 | } |
| 1363 | |
| 1364 | bool RichTextViewDelegate::linkHover(QMouseEvent *e, const QFont &font, const QModelIndex &index) |
| 1365 | { |
nothing calls this directly
no test coverage detected