src/linetypes/metacommand.cpp

Tue, 21 Sep 2021 16:00:15 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Tue, 21 Sep 2021 16:00:15 +0300
changeset 132
488d0ba6070b
parent 86
4bec0525ef1b
child 134
f77d2230e87c
permissions
-rw-r--r--

Begin work with serialization

#include "metacommand.h"

ldraw::MetaCommand::MetaCommand(QStringView text) :
	Object{},
	storedText{text.toString()} {}

QVariant ldraw::MetaCommand::getProperty(Property property) const
{
	switch (property)
	{
	case Property::Text:
		return storedText;
	default:
		return Object::getProperty(property);
	}
}

void ldraw::MetaCommand::setProperty(ldraw::Object::SetPropertyResult* result, const PropertyKeyValue& pair)
{
	LDRAW_OBJECT_HANDLE_SET_PROPERTY(Text, {this->storedText = value;});
	BaseClass::setProperty(result, pair);
}

QString ldraw::MetaCommand::textRepresentation() const
{
	return this->storedText;
}

ldraw::Object::Type ldraw::MetaCommand::typeIdentifier() const
{
	return Type::MetaCommand;
}

mercurial