#ifndef SERIALIZATIONUTILS_H
#define SERIALIZATIONUTILS_H

#include <QJsonObject>
#include <QPen>
#include <QBrush>
#include <QGraphicsItem>

QString penStyleToString(Qt::PenStyle style);
Qt::PenStyle penStyleFromString(const QString &str);

QJsonObject serializePen(const QPen &pen);
QPen deserializePen(const QJsonObject &obj);
QJsonObject serializeBrush(const QBrush &brush);

QJsonObject serializeCommon(const QGraphicsItem *item, const QString &type);
void applyCommon(QGraphicsItem *item, const QJsonObject &obj);

#endif // SERIALIZATIONUTILS_H
