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

Method selectActionItem

app/src/DataModel/ProjectEditor.cpp:5194–5214  ·  view source on GitHub ↗

* @brief Switches the form to the ActionView for the clicked action item. */

Source from the content-addressed store, hash-verified

5192 * @brief Switches the form to the ActionView for the clicked action item.
5193 */
5194bool DataModel::ProjectEditor::selectActionItem(QStandardItem* item)
5195{
5196 if (!m_actionItems.contains(item))
5197 return false;
5198
5199 auto& pm = DataModel::ProjectModel::instance();
5200 const auto cached = m_actionItems.value(item);
5201 const auto& actions = pm.actions();
5202 DataModel::Action live = cached;
5203 for (const auto& a : actions) {
5204 if (a.actionId == cached.actionId) {
5205 live = a;
5206 break;
5207 }
5208 }
5209
5210 pm.setSelectedAction(live);
5211 setCurrentView(ActionView);
5212 buildActionModel(live);
5213 return true;
5214}
5215
5216/**
5217 * @brief Switches the form to the OutputWidgetView for the clicked widget item.

Callers

nothing calls this directly

Calls 4

actionsMethod · 0.80
setSelectedActionMethod · 0.80
containsMethod · 0.45
valueMethod · 0.45

Tested by

no test coverage detected