MCPcopy Create free account
hub / github.com/MayaPosch/NymphCast / mouseDoubleClickEvent

Method mouseDoubleClickEvent

player/NymphCastPlayer/container_qpainter.cpp:1076–1102  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1074}
1075
1076QVector<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
1104QVector<QRect> DocumentContainer::leaveEvent()
1105{

Callers

nothing calls this directly

Calls 5

deepest_child_at_pointFunction · 0.85
appendMethod · 0.80
boundingRectMethod · 0.80
updateMethod · 0.45
isValidMethod · 0.45

Tested by

no test coverage detected