14 lines
370 B
C++
14 lines
370 B
C++
#ifndef SERIALIZATIONREGISTRY_H
|
|
#define SERIALIZATIONREGISTRY_H
|
|
|
|
#include <QGraphicsItem>
|
|
#include <QJsonObject>
|
|
#include <functional>
|
|
|
|
using ItemFactory = std::function<QGraphicsItem*(const QJsonObject&)>;
|
|
|
|
void registerItemFactory(const QString &type, ItemFactory factory);
|
|
QGraphicsItem *createItemFromJson(const QJsonObject &obj);
|
|
|
|
#endif // SERIALIZATIONREGISTRY_H
|