MCPcopy Create free account
hub / github.com/OpenShot/libopenshot / SetJsonValue

Method SetJsonValue

src/QtHtmlReader.cpp:219–248  ·  view source on GitHub ↗

Load Json::Value into this object

Source from the content-addressed store, hash-verified

217
218// Load Json::Value into this object
219void QtHtmlReader::SetJsonValue(const Json::Value root) {
220
221 // Set parent data
222 ReaderBase::SetJsonValue(root);
223
224 // Set data from Json (if key is found)
225 if (!root["width"].isNull())
226 width = root["width"].asInt();
227 if (!root["height"].isNull())
228 height = root["height"].asInt();
229 if (!root["x_offset"].isNull())
230 x_offset = root["x_offset"].asInt();
231 if (!root["y_offset"].isNull())
232 y_offset = root["y_offset"].asInt();
233 if (!root["html"].isNull())
234 html = root["html"].asString();
235 if (!root["css"].isNull())
236 css = root["css"].asString();
237 if (!root["background_color"].isNull())
238 background_color = root["background_color"].asString();
239 if (!root["gravity"].isNull())
240 gravity = (GravityType) root["gravity"].asInt();
241
242 // Re-Open path, and re-init everything (if needed)
243 if (is_open)
244 {
245 Close();
246 Open();
247 }
248}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected