From 53dfc2a919fd03f5570cb106d71d3989a3f528d9 Mon Sep 17 00:00:00 2001 From: Renato Araujo Oliveira Filho Date: Tue, 13 Nov 2012 17:16:59 -0300 Subject: Created auxiliary functions. To allows access the model data from JavaScript; --- libqmenumodel/src/qmenumodel.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'libqmenumodel/src/qmenumodel.h') 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); -- cgit v1.2.3