35 lines
696 B
C++
35 lines
696 B
C++
#pragma once
|
|
#include <vector>
|
|
#include <memory>
|
|
#include "item.h"
|
|
|
|
#include <QJsonObject>
|
|
|
|
class ItemStore: public QObject
|
|
{
|
|
Q_OBJECT
|
|
private:
|
|
std::vector< std::shared_ptr<Item> > items_;
|
|
|
|
public:
|
|
|
|
ItemStore(QObject *parent = nullptr);
|
|
virtual ~ItemStore(){}
|
|
|
|
inline std::vector< std::shared_ptr<Item> >* getItems(){ return &items_; }
|
|
|
|
void clear();
|
|
|
|
signals:
|
|
|
|
void itemDeleted(ItemData item);
|
|
void itemAdded(std::weak_ptr<Item> Item);
|
|
|
|
public slots:
|
|
|
|
void removeItem(const ItemData& item);
|
|
void addItem(std::shared_ptr<Item> item);
|
|
void addItems(const std::vector<std::shared_ptr<Item>>& itemsIn);
|
|
void itemStateChanged(const ItemData& item);
|
|
};
|