blob: d5391492163dafa00e609bb1dd11506cf9e67870 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
|
#ifndef QICCLIENT_CATALOG_HXX
#define QICCLIENT_CATALOG_HXX
#include <QAbstractListModel>
#include <qicclient/product.hxx>
struct icclient_catalog;
namespace ICClient {
class Catalog : public QAbstractListModel
{
Q_OBJECT
public:
explicit Catalog(QObject* parent = nullptr)
: QAbstractListModel{parent} {}
int rowCount(QModelIndex const& parent
= QModelIndex()) const Q_DECL_OVERRIDE;
QVariant data(const QModelIndex& index
, int role = Qt::DisplayRole
) const Q_DECL_OVERRIDE;
public slots:
void update(icclient_catalog* catalog);
signals:
void updated();
protected:
QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE;
private:
void addProduct(Product const& product);
QList<Product> products;
};
}
#endif // QICCLIENT_CATALOG_HXX
|