add swipe gesture

This commit is contained in:
xueyan hu
2022-01-18 16:40:18 +08:00
parent 61e5d547f8
commit 437423dd00
9 changed files with 215 additions and 116 deletions

View File

@@ -46,6 +46,7 @@ char* JsonObject::getJsonString(const char* catergory, const char* stringName)
if (!first) return nullptr;
cJSON* second = cJSON_GetObjectItem(first, stringName);
if (!second) return nullptr;
return second->valuestring;
}
@@ -61,8 +62,10 @@ char* JsonObject::getArrayNode(const char* catergory, const char* stringName, in
if (!second) return nullptr;
cJSON* third = cJSON_GetArrayItem(second, index);
if (!third) return nullptr;
cJSON* fourth = cJSON_GetObjectItem(third, id);
if (!fourth) return nullptr;
return fourth->valuestring;
}
@@ -78,7 +81,7 @@ void JsonObject::setArrayNode(const char* catergory, const char* stringName, int
if (!second) return;
cJSON* third = cJSON_GetArrayItem(second, index);
if (!third) return;
cJSON* Item = cJSON_CreateString(stringValue);
cJSON_ReplaceItemInObject(third, id, Item);
}
@@ -93,7 +96,7 @@ int JsonObject::getArraySize(const char* catergory, const char* stringName)
if (!first) return 0;
cJSON* second = cJSON_GetObjectItem(first, stringName);
if (!second) return 0;
return cJSON_GetArraySize(second);
}
@@ -153,6 +156,8 @@ QStringList JsonObject::worklistFilters()
if (!first) return QStringList();
cJSON* second = cJSON_GetObjectItem(first, "lists");
std::string lans = second->valuestring;
QString str = QString::fromLocal8Bit(QByteArray::fromRawData(lans.c_str(), lans.size()));
return str.split(";");
@@ -170,6 +175,8 @@ QStringList JsonObject::language()
if (!first) return QStringList();
cJSON* second = cJSON_GetObjectItem(first, "language");
if (!second) return QStringList();
std::string lans = second->valuestring;
QString str = QString::fromLocal8Bit(QByteArray::fromRawData(lans.c_str(), lans.size()));
return str.split(";");