#ifndef INTERFACES_H #define INTERFACES_H #include class Interface; class Interfaces : public QAbstractListModel { Q_OBJECT Q_PROPERTY(int count READ rowCount CONSTANT) public: enum Roles { RoleName, RoleDisplayName }; explicit Interfaces(QObject *parent = nullptr); int rowCount(const QModelIndex &parent = QModelIndex()) const override; QVariant data(const QModelIndex &index, int role) const override; QHash roleNames() const override; Q_INVOKABLE Interface* get(int index) const; Q_INVOKABLE Interface* findByName(const QString &name) const; private: QList m_list; }; #endif // INTERFACES_H