Created
March 2, 2015 11:35
-
-
Save alexzaporozhets/dc51ccb8212484e959e5 to your computer and use it in GitHub Desktop.
tasks.hh
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <QtCore> | |
struct Task | |
{ | |
Task(const QJsonObject &jsonObj) | |
{ | |
project = jsonObj["project"].toString(); | |
name = jsonObj["name"].toString(); | |
description = jsonObj["description"].toString(); | |
status = jsonObj["status"].toString(); | |
weight = jsonObj["weight"].toString(); | |
active = jsonObj["active"].toString(); | |
assignedTo = jsonObj["assignedTo"].toString(); | |
QJsonArray::ConstIterator i; | |
QJsonArray jsonArray; | |
} | |
Task(const Task &other) | |
{ | |
operator =(other); | |
} | |
Task &operator =(const Task &other) | |
{ | |
project = other.project; | |
name = other.name; | |
description = other.description; | |
status = other.status; | |
weight = other.weight; | |
active = other.active; | |
assignedTo = other.assignedTo; | |
return *this; | |
} | |
QJsonObject toJsonObject() const | |
{ | |
QJsonObject jsonObj; | |
jsonObj["project"] = project; | |
jsonObj["name"] = name; | |
jsonObj["description"] = description; | |
jsonObj["status"] = status; | |
jsonObj["weight"] = weight; | |
jsonObj["active"] = active; | |
jsonObj["assignedTo"] = assignedTo; | |
QJsonArray jsonArray; | |
return jsonObj; | |
} | |
QString project; | |
QString name; | |
QString description; | |
QString status; | |
QString weight; | |
QString active; | |
QString assignedTo; | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment