| 1074 | } |
| 1075 | |
| 1076 | QVector<QRect> DocumentContainer::mouseDoubleClickEvent(const QPoint &documentPos, |
| 1077 | const QPoint &viewportPos, |
| 1078 | Qt::MouseButton button) |
| 1079 | { |
| 1080 | if (!d->m_document || button != Qt::LeftButton) |
| 1081 | return {}; |
| 1082 | QVector<QRect> redrawRects; |
| 1083 | d->m_selection = {}; |
| 1084 | d->m_selection.mode = Selection::Mode::Word; |
| 1085 | const Selection::Element element = deepest_child_at_point(d->m_document, |
| 1086 | documentPos, |
| 1087 | viewportPos, |
| 1088 | d->m_selection.mode); |
| 1089 | if (element.element) { |
| 1090 | d->m_selection.startElem = element; |
| 1091 | d->m_selection.endElem = d->m_selection.startElem; |
| 1092 | d->m_selection.isSelecting = true; |
| 1093 | d->m_selection.update(); |
| 1094 | if (d->m_selection.isValid()) |
| 1095 | redrawRects.append(d->m_selection.boundingRect()); |
| 1096 | } else { |
| 1097 | if (d->m_selection.isValid()) |
| 1098 | redrawRects.append(d->m_selection.boundingRect()); |
| 1099 | d->m_selection = {}; |
| 1100 | } |
| 1101 | return redrawRects; |
| 1102 | } |
| 1103 | |
| 1104 | QVector<QRect> DocumentContainer::leaveEvent() |
| 1105 | { |
nothing calls this directly
no test coverage detected