This repository has been archived on 2026-05-31. You can view files and clone it, but cannot push or open issues or pull requests.
Michael Zanetti 113963a77b add support for tagging
rework the main page completely by using the new features available for tagging
2018-07-02 01:10:31 +02:00

45 lines
893 B
C++

#ifndef RULES_H
#define RULES_H
#include <QAbstractListModel>
class Rule;
class Rules : public QAbstractListModel
{
Q_OBJECT
Q_PROPERTY(int count READ rowCount NOTIFY countChanged)
public:
enum Roles {
RoleName,
RoleId,
RoleEnabled,
RoleActive,
RoleExecutable
};
explicit Rules(QObject *parent = nullptr);
void clear();
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role) const override;
QHash<int, QByteArray> roleNames() const override;
void insert(Rule *rule);
void remove(const QUuid &ruleId);
Q_INVOKABLE Rule* get(int index) const;
Q_INVOKABLE Rule* getRule(const QUuid &ruleId) const;
signals:
void countChanged();
private slots:
void ruleChanged();
private:
QList<Rule*> m_list;
};
#endif // RULES_H