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

Function jsonObjectToVariantMap

app/src/Misc/ThemeManager.cpp:45–58  ·  view source on GitHub ↗

* @brief Converts a QJsonObject to a QVariantMap. */

Source from the content-addressed store, hash-verified

43 * @brief Converts a QJsonObject to a QVariantMap.
44 */
45static QVariantMap jsonObjectToVariantMap(const QJsonObject& obj)
46{
47 QVariantMap map;
48 for (auto it = obj.constBegin(); it != obj.constEnd(); ++it)
49 map.insert(it.key(), it.value().toVariant());
50
51 if (map.contains("start-icon")) {
52 auto str = map["start-icon"].toString();
53 str = str.replace("/rcc/", "/");
54 map["start-icon"] = str;
55 }
56
57 return map;
58}
59
60/**
61 * @brief Extracts a vector of QColor objects from a JSON object.

Callers 2

setThemeMethod · 0.85
loadSystemThemeMethod · 0.85

Calls 4

keyMethod · 0.80
toVariantMethod · 0.80
valueMethod · 0.45
containsMethod · 0.45

Tested by

no test coverage detected