src/objecttypes/comment.cpp

Sat, 05 Oct 2019 23:47:03 +0300

author
Teemu Piippo <teemu@hecknology.net>
date
Sat, 05 Oct 2019 23:47:03 +0300
changeset 7
68443f5be176
parent 6
73e448b2943d
child 8
44679e468ba9
permissions
-rw-r--r--

added the settings editor

#include <QFont>
#include "comment.h"

modelobjects::Comment::Comment(QStringView text) :
	BaseObject{},
	storedText{text.toString()} {}

QVariant modelobjects::Comment::getProperty(Property property) const
{
	switch (property)
	{
	case Property::Text:
		return storedText;
	default:
		return BaseObject::getProperty(property);
	}
}

auto modelobjects::Comment::setProperty(Property property, const QVariant& value)
	-> SetPropertyResult
{
	switch (property)
	{
	case Property::Text:
		storedText = value.toString();
		return SetPropertyResult::Success;
	default:
		return BaseObject::setProperty(property, value);
	}
}

QString modelobjects::Comment::textRepresentation() const
{
	return this->storedText;
}

QFont modelobjects::Comment::textRepresentationFont() const
{
	QFont font;
	font.setItalic(true);
	return font;
}

mercurial