TrainControllerUi/src/ui/itemscrollbox.h
2022-02-11 11:46:30 +01:00

45 lines
689 B
C++

#ifndef RELAYSCROLLBOX_H
#define RELAYSCROLLBOX_H
#include <QWidget>
#include <vector>
#include <memory>
#include <QScroller>
#include "itemwidget.h"
#include "../items/item.h"
#include "../items/itemstore.h"
namespace Ui
{
class RelayScrollBox;
}
class ItemScrollBox : public QWidget
{
Q_OBJECT
private:
std::vector< ItemWidget* > widgets_;
signals:
void deleteRequest(const ItemData& item);
public:
explicit ItemScrollBox(QWidget *parent = nullptr);
~ItemScrollBox();
void setItemStore(ItemStore* itemStore);
public slots:
void addItem(std::weak_ptr<Item> item);
void removeItem(const ItemData& item);
private:
Ui::RelayScrollBox *ui;
};
#endif // RELAYSCROLLBOX_H