You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
39 lines
611 B
39 lines
611 B
#include "dataobject.h"
|
|
|
|
DataObject::DataObject(QObject *parent)
|
|
: QObject{parent}
|
|
{
|
|
}
|
|
|
|
DataObject::DataObject(QString name, QString color)
|
|
{
|
|
setName(name);
|
|
setColor(color);
|
|
}
|
|
|
|
const QString &DataObject::name() const
|
|
{
|
|
return m_name;
|
|
}
|
|
|
|
void DataObject::setName(const QString &newName)
|
|
{
|
|
if (m_name == newName)
|
|
return;
|
|
m_name = newName;
|
|
emit nameChanged();
|
|
}
|
|
|
|
const QString &DataObject::color() const
|
|
{
|
|
return m_color;
|
|
}
|
|
|
|
void DataObject::setColor(const QString &newColor)
|
|
{
|
|
if (m_color == newColor)
|
|
return;
|
|
m_color = newColor;
|
|
emit colorChanged();
|
|
}
|