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

Method getLayout

app/src/API/Handlers/WindowHandler.cpp:463–477  ·  view source on GitHub ↗

* @brief Return the serialized layout JSON from WindowManager. */

Source from the content-addressed store, hash-verified

461 * @brief Return the serialized layout JSON from WindowManager.
462 */
463API::CommandResponse API::Handlers::WindowHandler::getLayout(const QString& id,
464 const QJsonObject& params)
465{
466 Q_UNUSED(params)
467
468 auto* wm = UI::UISessionRegistry::instance().primaryWindowManager();
469 if (!wm)
470 return noSession(id);
471
472 const QJsonObject layout = wm->serializeLayout();
473
474 QJsonObject result;
475 result[QStringLiteral("layout")] = layout;
476 return CommandResponse::makeSuccess(id, result);
477}
478
479/**
480 * @brief Apply a layout to the WindowManager.

Callers

nothing calls this directly

Calls 3

noSessionFunction · 0.85
primaryWindowManagerMethod · 0.80
serializeLayoutMethod · 0.80

Tested by

no test coverage detected