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

Method selectTemplate

app/src/DataModel/Editors/FrameParserModel.cpp:306–322  ·  view source on GitHub ↗

* @brief Shows a native-template picker dialog and applies the chosen template. */

Source from the content-addressed store, hash-verified

304 * @brief Shows a native-template picker dialog and applies the chosen template.
305 */
306void DataModel::FrameParserModel::selectTemplate()
307{
308 bool ok = false;
309 const auto name = QInputDialog::getItem(nullptr,
310 tr("Select Frame Parser Template"),
311 tr("Choose a template to load:"),
312 m_templateNames,
313 templateIndex(),
314 false,
315 &ok);
316 if (!ok)
317 return;
318
319 const int idx = m_templateNames.indexOf(name);
320 if (idx >= 0)
321 setTemplateIndex(idx);
322}
323
324/**
325 * @brief Selects the template at the registry index and seeds its default parameters.

Callers

nothing calls this directly

Calls 1

indexOfMethod · 0.45

Tested by

no test coverage detected