MCPcopy Create free account
hub / github.com/Serial-Studio/Serial-Studio / mousePressEvent

Method mousePressEvent

app/src/DataModel/Editors/OutputCodeEditor.cpp:585–598  ·  view source on GitHub ↗

@brief Forwards mouse-press events to the backing widget after offsetting for the line-number * gutter. */

Source from the content-addressed store, hash-verified

583/** @brief Forwards mouse-press events to the backing widget after offsetting for the line-number
584 * gutter. */
585void DataModel::OutputCodeEditor::mousePressEvent(QMouseEvent* event)
586{
587 const auto lineNumWidth = m_widget.lineNumberArea()->sizeHint().width();
588 QMouseEvent copy(event->type(),
589 event->position() - QPointF(lineNumWidth, 0),
590 event->globalPosition(),
591 event->button(),
592 event->buttons(),
593 event->modifiers(),
594 event->pointingDevice());
595 QCoreApplication::sendEvent(m_widget.viewport(), &copy);
596 forceActiveFocus();
597 renderWidget();
598}
599
600/** @brief Forwards mouse-move events to the backing widget after offsetting for the line-number
601 * gutter. */

Callers

nothing calls this directly

Calls 4

widthMethod · 0.80
sizeHintMethod · 0.80
lineNumberAreaMethod · 0.80
typeMethod · 0.45

Tested by

no test coverage detected