First version

This commit is contained in:
Aurélie Delhaie
2022-02-01 19:08:44 +01:00
commit d661cc7b42
26 changed files with 1896 additions and 0 deletions

45
src/models/note.cpp Executable file
View File

@@ -0,0 +1,45 @@
#include "note.h"
Note::Note()
{
}
QJsonObject Note::toJson()
{
QJsonObject o;
o["title"] = this->title;
o["content"] = this->content;
return o;
}
Note *Note::fromJson(QJsonObject o)
{
Note *n = new Note();
n->title = o["title"].toString();
n->content = o["content"].toString();
return n;
}
QString Note::getTitle()
{
return title;
}
QString Note::getContent()
{
return content;
}
void Note::setTitle(QString value)
{
this->title = value;
}
void Note::setContent(QString value)
{
this->content = value;
}

26
src/models/note.h Executable file
View File

@@ -0,0 +1,26 @@
#ifndef NOTE_H
#define NOTE_H
#include <QString>
#include <QJsonObject>
class Note
{
public:
Note();
QJsonObject toJson();
static Note* fromJson(QJsonObject o);
QString getTitle();
QString getContent();
void setTitle(QString value);
void setContent(QString value);
private:
QString title;
QString content;
};
#endif // NOTE_H