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..9371bd8 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,17 @@ public: ~QMenuModel(); + Q_INVOKABLE QVariantMap get(int row) 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); @@ -63,6 +69,7 @@ private: QVariant getExtraProperties(const QModelIndex &index) const; QString parseExtraPropertyName(const QString &name) const; void clearModel(); + int count() const; static void onItemsChanged(GMenuModel *model, gint position, gint removed, gint added, gpointer data); }; |