diff options
Diffstat (limited to 'mobile/commandmodel.h')
| -rw-r--r-- | mobile/commandmodel.h | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/mobile/commandmodel.h b/mobile/commandmodel.h index e68c91e..2c20072 100644 --- a/mobile/commandmodel.h +++ b/mobile/commandmodel.h @@ -22,10 +22,25 @@ #include <QObject> +#include <QAbstractListModel> + class CommandModel : public QAbstractListModel { + Q_OBJECT public: + enum CustomRole {NameRole = Qt::UserRole+1,CmdRole}; CommandModel(); + + virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole ) const; + virtual int rowCount(const QModelIndex &parent) const; + + QHash<int, QByteArray> roleNames() const; + + +public slots: + void insertCmd(QString name, QString cmd); +private: + QList<QPair<QString,QString> > m_data; }; -#endif // COMMANDMODEL_H
\ No newline at end of file +#endif // COMMANDMODEL_H |