#ifndef ACTIONS_GROUPS_MODEL_H #define ACTIONS_GROUPS_MODEL_H #include #include class QAction; class ActionsGroup { public: ActionsGroup(const QString &name, const QIcon &icon, QList &actions); QString getName() const; QIcon getIcon() const; QList getActions() const; protected: QString name; QIcon icon; QList actions; }; class ActionsGroupsModel : public QAbstractItemModel { Q_OBJECT public: explicit ActionsGroupsModel(QObject *parent = 0); int rowCount(const QModelIndex &parent = QModelIndex()) const; int columnCount(const QModelIndex &parent = QModelIndex()) const; QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const; QVariant data(const QModelIndex &index, int role) const; QModelIndex parent(const QModelIndex &index) const; void addActionsGroup(const ActionsGroup &group); QList getActions(const QModelIndex &mi); signals: public slots: protected: QList groups; }; #endif // ACTIONS_GROUPS_MODEL_H