2018-07-25 16:04:45 +02:00
|
|
|
#ifndef SALEMODEL_H
|
|
|
|
#define SALEMODEL_H
|
|
|
|
|
|
|
|
#include <marketplace.h>
|
|
|
|
|
|
|
|
#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,
|
2018-07-25 16:04:45 +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:
|
|
|
|
Marketplace* marketplace_;
|
|
|
|
std::unique_ptr<Sale> rootItem{new Sale()};
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|