| 37 | } |
| 38 | |
| 39 | bool SettingMetaFloat::Load(const QJsonObject& json_setting) { |
| 40 | this->default_value = ReadFloatValue(json_setting, "default"); |
| 41 | if (json_setting.value("range") != QJsonValue::Undefined) { |
| 42 | const QJsonObject& json_setting_range = ReadObject(json_setting, "range"); |
| 43 | if (json_setting_range.value("min") != QJsonValue::Undefined) { |
| 44 | this->min_value = ReadFloatValue(json_setting_range, "min"); |
| 45 | } |
| 46 | if (json_setting_range.value("max") != QJsonValue::Undefined) { |
| 47 | this->max_value = ReadFloatValue(json_setting_range, "max"); |
| 48 | } |
| 49 | if (json_setting_range.value("precision") != QJsonValue::Undefined) { |
| 50 | this->precision = ReadIntValue(json_setting_range, "precision"); |
| 51 | } |
| 52 | if (json_setting_range.value("width") != QJsonValue::Undefined) { |
| 53 | this->width = ReadIntValue(json_setting_range, "width"); |
| 54 | } |
| 55 | } |
| 56 | if (json_setting.value("unit") != QJsonValue::Undefined) { |
| 57 | this->unit = ReadStringValue(json_setting, "unit"); |
| 58 | } |
| 59 | |
| 60 | return true; |
| 61 | } |
| 62 | |
| 63 | std::string SettingMetaFloat::Export(ExportMode export_mode) const { |
| 64 | (void)export_mode; |
nothing calls this directly
no test coverage detected