File indexing completed on 2024-04-28 15:35:52

0001 // SPDX-FileCopyrightText: 2012 Dan Leinir Turthra Jensen <admin@leinir.dk>
0002 // SPDX-License-Identifier: LGPL-2.1-only or LGPL-3.0-only or LicenseRef-KDE-Accepted-LGPL
0003 
0004 #include "propertycontainer.h"
0005 
0006 PropertyContainer::PropertyContainer::PropertyContainer(QObject *parent)
0007     : QObject(parent)
0008     , m_name(QStringLiteral("unnamed"))
0009 {
0010 }
0011 
0012 PropertyContainer::PropertyContainer(const QString &name, QObject *parent)
0013     : QObject(parent)
0014     , m_name(name)
0015 {
0016 }
0017 
0018 PropertyContainer::~PropertyContainer() = default;
0019 
0020 void PropertyContainer::writeProperty(const QString &name, const QVariant &value)
0021 {
0022     setProperty(name.toLatin1().toStdString().c_str(), value);
0023 }
0024 
0025 QVariant PropertyContainer::readProperty(const QString &name)
0026 {
0027     return property(name.toLatin1().toStdString().c_str());
0028 }
0029 
0030 QString PropertyContainer::name() const
0031 {
0032     return m_name;
0033 }
0034 
0035 #include "moc_propertycontainer.cpp"