kima2/src/gui/salemodel.h
2022-07-07 15:37:33 +02:00

31 lines
1 KiB
C++

#ifndef SALEMODEL_H
#define SALEMODEL_H
#include <core/marketplace.h>
#include <QAbstractItemModel>
class SaleModel : public QAbstractItemModel
{
Q_OBJECT
public:
explicit SaleModel(Marketplace* market, QObject* parent = nullptr);
virtual QModelIndex index(int row, int column,
const QModelIndex& parent = QModelIndex()) const override;
virtual QModelIndex parent(const QModelIndex& index) const override;
virtual QVariant data(const QModelIndex& index, int role) const override;
virtual int rowCount(const QModelIndex& parent) const override;
virtual int columnCount(const QModelIndex& parent) const override;
virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
virtual bool removeRows(int row, int count, const QModelIndex& parent = QModelIndex()) override;
public slots:
void onBasketDataChanged();
private:
Marketplace* m_marketplace;
std::unique_ptr<Sale> m_rootItem{new Sale()};
};
#endif