You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
34 lines
776 B
C++
34 lines
776 B
C++
|
4 years ago
|
#include "lpdesignerConfig.h"
|
||
|
|
#include <QApplication>
|
||
|
|
#include <QFile>
|
||
|
|
#include <QJsonDocument>
|
||
|
|
#include <QJsonObject>
|
||
|
|
lpdesignerConfig::lpdesignerConfig(QObject *parent)
|
||
|
|
: QObject(parent)
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
lpdesignerConfig::~lpdesignerConfig()
|
||
|
|
{
|
||
|
|
}
|
||
|
|
|
||
|
|
void lpdesignerConfig::readConfig()
|
||
|
|
{
|
||
|
|
QString fileMyself = QApplication::applicationDirPath() + "\\user\\selfdefine.json";
|
||
|
|
QFile file(fileMyself);
|
||
|
|
if (true == file.open(QIODevice::ReadOnly))
|
||
|
|
{
|
||
|
|
QByteArray readData = file.readAll();
|
||
|
|
QJsonObject rootObj = QJsonDocument::fromJson(readData).object();
|
||
|
|
if (!rootObj.isEmpty())
|
||
|
|
{
|
||
|
|
QJsonObject detectImage = rootObj.value("DetectImage").toObject();
|
||
|
|
if (!detectImage.isEmpty())
|
||
|
|
{
|
||
|
|
m_SaveImgDirPath = detectImage.value("SaveImgPath").toString();
|
||
|
|
}
|
||
|
|
}
|
||
|
|
}
|
||
|
|
file.close();
|
||
|
|
}
|