diff options
author | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-11-13 17:16:59 -0300 |
---|---|---|
committer | Renato Araujo Oliveira Filho <renato.filho@canonical.com> | 2012-11-13 17:16:59 -0300 |
commit | 53dfc2a919fd03f5570cb106d71d3989a3f528d9 (patch) | |
tree | 43f75f57c482c2c75f86f10c5877683a24859412 /libqmenumodel/src/qmenumodel.h | |
parent | 1915b094437bc94aa4ea44e4ccf489456f375e06 (diff) | |
download | qmenumodel-53dfc2a919fd03f5570cb106d71d3989a3f528d9.tar.gz qmenumodel-53dfc2a919fd03f5570cb106d71d3989a3f528d9.tar.bz2 qmenumodel-53dfc2a919fd03f5570cb106d71d3989a3f528d9.zip |
Created auxiliary functions. To allows access the model data from JavaScript;
Diffstat (limited to 'libqmenumodel/src/qmenumodel.h')
-rw-r--r-- | libqmenumodel/src/qmenumodel.h | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/libqmenumodel/src/qmenumodel.h b/libqmenumodel/src/qmenumodel.h index 22c30df..ac40db5 100644 --- a/libqmenumodel/src/qmenumodel.h +++ b/libqmenumodel/src/qmenumodel.h @@ -30,6 +30,7 @@ typedef struct _GMenuModel GMenuModel; class QMenuModel : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(int count READ count NOTIFY countChanged) public: enum MenuRoles { @@ -42,11 +43,17 @@ public: ~QMenuModel(); + Q_INVOKABLE QVariantMap get(int row) const; + int count() const; + /* QAbstractItemModel */ QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const; QModelIndex parent (const QModelIndex &index) const; int rowCount(const QModelIndex &parent = QModelIndex()) const; +Q_SIGNALS: + void countChanged(); + protected: QMenuModel(GMenuModel *other=0, QObject *parent=0); void setMenuModel(GMenuModel *model); |