29 lines
521 B
C++
29 lines
521 B
C++
#ifndef SUMMARYMODEL_H
|
|
#define SUMMARYMODEL_H
|
|
|
|
#include <QObject>
|
|
#include <QVariantMap>
|
|
|
|
class SummaryModel : public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(QVariantList items READ items NOTIFY itemsChanged)
|
|
Q_PROPERTY(float sum READ sum NOTIFY itemsChanged)
|
|
|
|
public:
|
|
QVariantList items() const;
|
|
float sum() const;
|
|
|
|
Q_INVOKABLE void setItemCount(QVariantMap item, int count);
|
|
Q_INVOKABLE void clear();
|
|
|
|
signals:
|
|
void itemsChanged();
|
|
|
|
private:
|
|
QVariantMap m_items;
|
|
};
|
|
|
|
#endif // SUMMARYMODEL_H
|