Load Json::Value into this object
| 236 | |
| 237 | // Load Json::Value into this object |
| 238 | void QtTextReader::SetJsonValue(const Json::Value root) { |
| 239 | |
| 240 | // Set parent data |
| 241 | ReaderBase::SetJsonValue(root); |
| 242 | |
| 243 | // Set data from Json (if key is found) |
| 244 | if (!root["width"].isNull()) |
| 245 | width = root["width"].asInt(); |
| 246 | if (!root["height"].isNull()) |
| 247 | height = root["height"].asInt(); |
| 248 | if (!root["x_offset"].isNull()) |
| 249 | x_offset = root["x_offset"].asInt(); |
| 250 | if (!root["y_offset"].isNull()) |
| 251 | y_offset = root["y_offset"].asInt(); |
| 252 | if (!root["text"].isNull()) |
| 253 | text = root["text"].asString(); |
| 254 | if (!root["font"].isNull()) |
| 255 | font.fromString(QString::fromStdString(root["font"].asString())); |
| 256 | if (!root["text_color"].isNull()) |
| 257 | text_color = root["text_color"].asString(); |
| 258 | if (!root["background_color"].isNull()) |
| 259 | background_color = root["background_color"].asString(); |
| 260 | if (!root["text_background_color"].isNull()) |
| 261 | text_background_color = root["text_background_color"].asString(); |
| 262 | if (!root["gravity"].isNull()) |
| 263 | gravity = (GravityType) root["gravity"].asInt(); |
| 264 | |
| 265 | // Re-Open path, and re-init everything (if needed) |
| 266 | if (is_open) |
| 267 | { |
| 268 | Close(); |
| 269 | Open(); |
| 270 | } |
| 271 | } |
nothing calls this directly
no outgoing calls
no test coverage detected