inital commit
This commit is contained in:
34
src/items/itemstore.h
Normal file
34
src/items/itemstore.h
Normal file
@ -0,0 +1,34 @@
|
||||
#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);
|
||||
};
|
Reference in New Issue
Block a user