* @brief Switches the form to the ActionView for the clicked action item. */
| 5192 | * @brief Switches the form to the ActionView for the clicked action item. |
| 5193 | */ |
| 5194 | bool 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. |
nothing calls this directly
no test coverage detected