src/objecttypes/comment.cpp

changeset 3
55a55a9ec2c2
child 6
73e448b2943d
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/objecttypes/comment.cpp	Sun Sep 22 11:51:41 2019 +0300
@@ -0,0 +1,29 @@
+#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);
+	}
+}

mercurial