src/objecttypes/comment.cpp

changeset 8
44679e468ba9
parent 6
73e448b2943d
child 13
6e838748867b
equal deleted inserted replaced
7:68443f5be176 8:44679e468ba9
1 #include <QFont> 1 #include <QFont>
2 #include "comment.h" 2 #include "comment.h"
3
4 modelobjects::Comment::Comment(QStringView text) :
5 BaseObject{},
6 storedText{text.toString()} {}
7
8 QVariant modelobjects::Comment::getProperty(Property property) const
9 {
10 switch (property)
11 {
12 case Property::Text:
13 return storedText;
14 default:
15 return BaseObject::getProperty(property);
16 }
17 }
18
19 auto modelobjects::Comment::setProperty(Property property, const QVariant& value)
20 -> SetPropertyResult
21 {
22 switch (property)
23 {
24 case Property::Text:
25 storedText = value.toString();
26 return SetPropertyResult::Success;
27 default:
28 return BaseObject::setProperty(property, value);
29 }
30 }
31
32 QString modelobjects::Comment::textRepresentation() const
33 {
34 return this->storedText;
35 }
36 3
37 QFont modelobjects::Comment::textRepresentationFont() const 4 QFont modelobjects::Comment::textRepresentationFont() const
38 { 5 {
39 QFont font; 6 QFont font;
40 font.setItalic(true); 7 font.setItalic(true);

mercurial