7 Star 3 Fork 1

wjzhe / mapEditor

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pathJson.h 1.14 KB
一键复制 编辑 原始数据 按行查看 历史
#ifndef PATHJSON_H
#define PATHJSON_H
#include <QObject>
#include <qvariant.h>
#include <QFile>
#include <QJsonDocument>
#include <QJsonObject>
#include <QJsonValue>
#include <QJsonArray>
class PathJson : public QObject
{
Q_OBJECT
Q_PROPERTY(int mode READ mode WRITE setMode)
public:
explicit PathJson(QObject *parent = 0);
~PathJson();
int mode()
{
return m_mode;
}
void setMode(int mode)
{
if (mode) {
m_mode = QJsonDocument::Indented;
} else {
m_mode = QJsonDocument::Compact;
}
}
Q_INVOKABLE int saveJsonFile(QVariant var);
Q_INVOKABLE QVariant openJsonFile(QString fileName);
Q_INVOKABLE QVariant exportList();
Q_INVOKABLE QVariant exportParamObject();
Q_INVOKABLE void modifyItem(int index, QVariant var);
Q_INVOKABLE void insertItem(int index, QVariant var);
Q_INVOKABLE void deleteItem(int index);
Q_INVOKABLE void deleteAll();
Q_INVOKABLE void moveItem(int from, int to);
private:
signals:
public slots:
private:
QJsonDocument::JsonFormat m_mode;
QString m_file;
QJsonArray m_pathArray;
};
#endif // PATHJSON_H
C++
1
https://gitee.com/null_446_4477/mapeditor.git
git@gitee.com:null_446_4477/mapeditor.git
null_446_4477
mapeditor
mapEditor
master

搜索帮助