From 80c58c124caf17f670d8efc120f5ae4bfd9aa09f Mon Sep 17 00:00:00 2001 From: "Javier S. Pedro" Date: Tue, 14 May 2013 01:13:41 +0200 Subject: added liveview watchlet menu (API break) --- libsowatch/watchletsmodel.h | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'libsowatch/watchletsmodel.h') diff --git a/libsowatch/watchletsmodel.h b/libsowatch/watchletsmodel.h index cdb6be4..3bbabf9 100644 --- a/libsowatch/watchletsmodel.h +++ b/libsowatch/watchletsmodel.h @@ -12,15 +12,20 @@ namespace sowatch class WatchletsModel : public QAbstractListModel { Q_OBJECT + Q_PROPERTY(QString watchModel READ watchModel WRITE setWatchModel NOTIFY watchModelChanged) public: explicit WatchletsModel(QObject *parent = 0); enum DataRoles { ObjectRole = Qt::UserRole, - TitleRole = Qt::DisplayRole + TitleRole = Qt::DisplayRole, + IconRole = Qt::DecorationRole }; + QString watchModel() const; + void setWatchModel(const QString& s); + int rowCount(const QModelIndex &parent) const; QVariant data(const QModelIndex &index, int role) const; @@ -35,14 +40,16 @@ public: void remove(int position); signals: + void watchModelChanged(); void modelChanged(); protected: typedef WatchletPluginInterface::WatchletInfo WatchletInfo; - static WatchletInfo getInfoForWatchlet(const Watchlet *w); + WatchletInfo getInfoForWatchlet(const Watchlet *w); private: + QString _watchModel; QList _list; QList _info; -- cgit v1.2.3