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

Method keyPressEvent

app/src/DataModel/Editors/JsCodeEditor.cpp:665–675  ·  view source on GitHub ↗

* @brief Forwards completer navigation/commit keys to the popup when visible; everything else * goes straight to the editor widget so QCompleter's focus check cannot hide the popup. */

Source from the content-addressed store, hash-verified

663 * goes straight to the editor widget so QCompleter's focus check cannot hide the popup.
664 */
665void DataModel::JsCodeEditor::keyPressEvent(QKeyEvent* event)
666{
667 auto* completer = m_widget.completer();
668 if (completer && completer->popup() && completer->popup()->isVisible()
669 && SerialStudioCompleter::popupHandlesKey(event->key()))
670 QCoreApplication::sendEvent(completer->popup(), event);
671 else
672 QCoreApplication::sendEvent(&m_widget, event);
673
674 renderWidget();
675}
676
677/**
678 * @brief Forwards key-release events to the backing QCodeEditor widget.

Callers

nothing calls this directly

Calls 2

completerMethod · 0.80
keyMethod · 0.80

Tested by

no test coverage detected