* @brief Builds and shows the editor's right-click menu with format entries. */
| 354 | * @brief Builds and shows the editor's right-click menu with format entries. |
| 355 | */ |
| 356 | void 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. |