diff options
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 1ab1e7a..f923658 100644 --- a/libqmenumodel/src/qmenumodel.h +++ b/libqmenumodel/src/qmenumodel.h @@ -31,6 +31,7 @@ typedef struct _GObject GObject; class QMenuModel : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(int count READ count NOTIFY countChanged) public: enum MenuRoles { @@ -43,12 +44,18 @@ public: ~QMenuModel(); + Q_INVOKABLE QVariantMap get(int row) const; + int count() const; + /* QAbstractItemModel */ QHash<int, QByteArray> roleNames() const; 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); |