File indexing completed on 2024-12-15 03:45:00

0001 /*
0002     SPDX-FileCopyrightText: 2016 Volker Krause <vkrause@kde.org>
0003 
0004     SPDX-License-Identifier: MIT
0005 */
0006 
0007 
0008 #ifndef KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTMODEL_H
0009 #define KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTMODEL_H
0010 
0011 #include <core/aggregation.h>
0012 
0013 #include <QAbstractListModel>
0014 #include <QVector>
0015 
0016 namespace KUserFeedback {
0017 namespace Console {
0018 
0019 class Product;
0020 
0021 class AggregationElementModel : public QAbstractListModel
0022 {
0023     Q_OBJECT
0024 public:
0025     explicit AggregationElementModel(QObject *parent = nullptr);
0026     ~AggregationElementModel() override;
0027 
0028     void setProduct(const Product &product);
0029 
0030     int rowCount(const QModelIndex & parent) const override;
0031     QVariant data(const QModelIndex & index, int role) const override;
0032     QModelIndexList match(const QModelIndex & start, int role, const QVariant & value, int hits, Qt::MatchFlags flags) const override;
0033 
0034 private:
0035     QVector<AggregationElement> m_elements;
0036 };
0037 }
0038 }
0039 
0040 #endif // KUSERFEEDBACK_CONSOLE_AGGREGATIONELEMENTMODEL_H