31 lines
No EOL
1,013 B
C++
31 lines
No EOL
1,013 B
C++
#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);
|
|
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* marketplace_;
|
|
std::unique_ptr<Sale> rootItem{new Sale()};
|
|
};
|
|
|
|
#endif |