Imported existing sources

This commit is contained in:
0xFEEDC0DE64
2018-09-16 06:05:23 +02:00
parent 522ad6ee77
commit 8ff2754dd3
91 changed files with 4988 additions and 0 deletions
+56
View File
@@ -0,0 +1,56 @@
#include "group.h"
#include <QDebug>
#include <QJsonValue>
#include <QJsonObject>
#include <QJsonArray>
#include "containerfactory.h"
#include "layer.h"
Group::Group(QObject *parent) :
Layer(parent),
m_hasClickThrough(false)
{
}
const QList<Layer *> &Group::layers() const
{
return m_layers;
}
bool Group::hasClickThrough() const
{
return m_hasClickThrough;
}
bool Group::parseProperty(const QString &key, const QJsonValue &value)
{
if(key == QStringLiteral("layers"))
{
Q_ASSERT(value.isArray());
for(auto layerValue : value.toArray())
{
Q_ASSERT(layerValue.isObject());
m_layers.append(ContainerFactory::createContainer<Layer>(layerValue.toObject()));
}
return true;
}
if(key == QStringLiteral("flow"))
{
Q_ASSERT(value.isObject());
//qWarning() << "flow not implemented";
return true;
}
if(key == QStringLiteral("hasClickThrough"))
{
Q_ASSERT(value.isBool());
m_hasClickThrough = value.toBool();
return true;
}
return Layer::parseProperty(key, value);
}