Imported existing sources
This commit is contained in:
@@ -0,0 +1,42 @@
|
||||
#include "sharedstyle.h"
|
||||
|
||||
#include <QJsonValue>
|
||||
#include <QJsonObject>
|
||||
|
||||
#include "containerfactory.h"
|
||||
|
||||
#include "style.h"
|
||||
|
||||
SharedStyle::SharedStyle(QObject *parent) :
|
||||
BaseContainer(parent)
|
||||
{
|
||||
}
|
||||
|
||||
const QString &SharedStyle::name() const
|
||||
{
|
||||
return m_name;
|
||||
}
|
||||
|
||||
Style *SharedStyle::value() const
|
||||
{
|
||||
return m_value;
|
||||
}
|
||||
|
||||
bool SharedStyle::parseProperty(const QString &key, const QJsonValue &value)
|
||||
{
|
||||
if(key == QStringLiteral("name"))
|
||||
{
|
||||
Q_ASSERT(value.isString());
|
||||
m_name = value.toString();
|
||||
return true;
|
||||
}
|
||||
|
||||
if(key == QStringLiteral("value"))
|
||||
{
|
||||
Q_ASSERT(value.isObject());
|
||||
m_value = ContainerFactory::createContainer<Style>(value.toObject(), this);
|
||||
return true;
|
||||
}
|
||||
|
||||
return BaseContainer::parseProperty(key, value);
|
||||
}
|
||||
Reference in New Issue
Block a user