| 8 | if (!File::SaveText(Qi::configFile, json.toJson(QJsonDocument::JsonFormat::Compact))) MsgBox::Error(L"保存配置失败"); |
| 9 | } |
| 10 | void LoadJson() |
| 11 | { |
| 12 | QByteArray text; |
| 13 | if (File::LoadText(Qi::configFile, text)) |
| 14 | { |
| 15 | QJsonDocument json(QJsonDocument::fromJson(text)); |
| 16 | if (json.isObject()) |
| 17 | { |
| 18 | Qi::fromJson(json.object()); |
| 19 | return; |
| 20 | } |
| 21 | } |
| 22 | Qi::fromJson(QJsonObject()); |
| 23 | } |
| 24 | } |