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

Method showEditorContextMenu

app/src/MQTT/PublisherScriptEditor.cpp:356–364  ·  view source on GitHub ↗

* @brief Builds and shows the editor's right-click menu with format entries. */

Source from the content-addressed store, hash-verified

354 * @brief Builds and shows the editor's right-click menu with format entries.
355 */
356void MQTT::PublisherScriptEditor::showEditorContextMenu(const QPoint& localPos)
357{
358 QMenu* menu = m_editor->createStandardContextMenu();
359 menu->addSeparator();
360 menu->addAction(tr("Format Document\tCtrl+Shift+I"), this, &PublisherScriptEditor::onFormat);
361 menu->addAction(tr("Format Selection\tCtrl+I"), this, &PublisherScriptEditor::onFormatLine);
362 menu->exec(m_editor->viewport()->mapToGlobal(localPos));
363 menu->deleteLater();
364}
365
366/**
367 * @brief Clears test fields and resets the editor to the default placeholder.

Callers

nothing calls this directly

Calls 2

addActionMethod · 0.80
execMethod · 0.80

Tested by

no test coverage detected