status-desktop/ui/StatusQ/include/StatusQ/singleroleaggregator.h
Noelia c2bfc6b8f4 feat(SQ/Aggregator): Created utility Aggregator
- Abstract class created: `Aggregator`
- Derived abstract class created: `SingleRoleAggregator`
- Derived class created:  `SumAggregator`
- `Storybook` page created.
- Added unit tests.

Closes #12685
2023-12-01 18:57:01 +01:00

28 lines
560 B
C++

#pragma once
#include <QObject>
#include "StatusQ/aggregator.h"
class SingleRoleAggregator : public Aggregator {
Q_OBJECT
Q_PROPERTY(QByteArray roleName READ roleName WRITE setRoleName NOTIFY roleNameChanged)
public:
explicit SingleRoleAggregator(QObject *parent = nullptr);
const QByteArray& roleName() const;
void setRoleName(const QByteArray &roleName);
signals:
void roleNameChanged();
protected:
bool acceptRoles(const QVector<int>& roles) override;
bool roleExists() const;
private:
QByteArray m_roleName;
};