2018-07-25 16:04:45 +02:00
|
|
|
#ifndef SALEMODEL_H
|
|
|
|
#define SALEMODEL_H
|
|
|
|
|
2019-10-10 08:09:16 +02:00
|
|
|
#include <core/marketplace.h>
|
2018-07-25 16:04:45 +02:00
|
|
|
|
|
|
|
#include <QAbstractItemModel>
|
|
|
|
|
|
|
|
class SaleModel : public QAbstractItemModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
explicit SaleModel(Marketplace* market, QObject* parent = nullptr);
|
2018-07-27 16:41:34 +02:00
|
|
|
virtual QModelIndex index(int row, int column,
|
2019-10-07 14:08:01 +02:00
|
|
|
const QModelIndex& parent = QModelIndex()) const override;
|
2018-07-27 16:41:34 +02:00
|
|
|
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;
|
2018-07-25 16:04:45 +02:00
|
|
|
|
2018-07-26 08:34:01 +02:00
|
|
|
public slots:
|
|
|
|
void onBasketDataChanged();
|
|
|
|
|
2018-07-25 16:04:45 +02:00
|
|
|
private:
|
2022-07-07 15:37:33 +02:00
|
|
|
Marketplace* m_marketplace;
|
|
|
|
std::unique_ptr<Sale> m_rootItem{new Sale()};
|
2018-07-25 16:04:45 +02:00
|
|
|
};
|
|
|
|
|
2019-10-10 08:09:16 +02:00
|
|
|
#endif
|