当前位置:网站首页>QT: parsing JSON
QT: parsing JSON
2022-06-25 10:24:00 【Wenlong Yang】
// Used to resolve Jsong data
void MainWindow::DecodeJson(QString JsonData)
{
qDebug()<<"--->"<<JsonData.toUtf8();
QJsonParseError parseJsonErr;
QJsonDocument document = QJsonDocument::fromJson(JsonData.toUtf8(),&parseJsonErr);
if(!(parseJsonErr.error == QJsonParseError::NoError))
{
qDebug()<<tr(" analysis json file error !");
return;
}
QJsonObject jsonObject = document.object();
if(jsonObject.contains(QStringLiteral("data"))){
qDebug()<<"--->"<<" Dad came in ";
QJsonValue arrayValue = jsonObject.value(QStringLiteral("data"));
if(arrayValue.isArray())
{
QJsonArray array = arrayValue.toArray();
for(int i=0;i<array.size();i++)
{
QJsonValue iconArray = array.at(i);
QJsonObject icon = iconArray.toObject();
QString player_name = icon["player_name"].toString();
QString player_type = icon["player_type"].toString();
QString player_search = icon["player_search"].toString();
qDebug()<<"player_name="<<player_name<<"player_type="<<player_type<<"player_search="<<player_search;
}
}
}
}边栏推荐
- Opencv learning (I) -- environment building
- Create menu file
- Kotlin advanced - class
- How to apply for a widget on wechat how to get a widget on wechat
- Gradle download warehouse is slow
- Kotlin keyword and operator
- Modbus protocol and serialport port read / write
- Principle of distribution: understanding the gossip protocol
- 【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence
- Redis(二)分布式锁与Redis集群搭建
猜你喜欢
![[today in history] June 24: Netease was established; The first consumer electronics exhibition was held; The first webcast in the world](/img/f7/b3239802d19d00f760bb3174649a89.jpg)
[today in history] June 24: Netease was established; The first consumer electronics exhibition was held; The first webcast in the world

Houdini图文笔记:Your driver settings have been set to force 4x Antialiasing in OpenGL applications问题的解决

ShardingSphere-Proxy 5.0 分库分表(一)

Floating window --- create an activity floating window (can be dragged)

String implementation strstr()

字符串 实现 strStr()

Redis (I) principle and basic use

我希望按照我的思路盡可能將canvas基礎講明白

Webapi performance optimization

How to develop wechat applet? How to open a wechat store
随机推荐
The real difference between i++ and ++i
[today in history] June 24: Netease was established; The first consumer electronics exhibition was held; The first webcast in the world
Opencv learning (II) -- installing opencv on raspberry pie
【动态规划】—— 数字三角形
Minio基本使用与原理
Can two Mitsubishi PLC adopt bcnettcp protocol to realize wireless communication of network interface?
[paper reading | deep reading] drne:deep recursive network embedding with regular equivalence
[paper reading | depth] role based network embedding via structural features reconstruction with degree regulated
Opencv learning (I) -- environment building
Jetpack compose layout (II) - material components and layout
P2P network core technology: Gossip protocol
Your driver settings have been set to force 4x antialiasing in OpenGL applications
【论文阅读|深读】DRNE:Deep Recursive Network Embedding with Regular Equivalence
Free applet making tool, how to make wechat applet
Flask博客实战 - 实现侧边栏文章归档及标签
NetCore性能排查
浅谈二叉树
OODA工作法
Kotlin Foundation
Unreal Engine graphics and text notes: use VAT (vertex animation texture) to make Houdini end on Houdini special effect (ue4/ue5)