ssu
ssufeaturemodel.h
Go to the documentation of this file.
1 
8 #ifndef _SSUFEATUREMODEL_H
9 #define _SSUFEATUREMODEL_H
10 
11 #include <QAbstractListModel>
12 
14 class FeatureModelTest;
15 
16 class SsuFeatureModel: public QAbstractListModel
17 {
18  Q_OBJECT
19  Q_PROPERTY(int count READ count NOTIFY countChanged)
20 public:
21  enum Roles {
22  Name = Qt::UserRole,
23  Version
24  };
25 
26  SsuFeatureModel(QObject *parent = 0);
27  SsuFeatureModel(QObject *parent, const QString &path);
28  ~SsuFeatureModel();
29 
30  virtual int rowCount(const QModelIndex &parent = QModelIndex()) const;
31  virtual QVariant data(const QModelIndex &index, int role) const;
32 
33 public slots:
34  void reload();
35  int count() const;
36 
37 protected:
38  QHash<int, QByteArray> roleNames() const;
39  const QHash<QByteArray, QString> &featureAt(int index) const;
40 
41 signals:
42  void countChanged();
43 
44 private:
46  friend class FeatureModelTest;
47 };
48 
49 #endif
FeatureModelTest
Definition: featuremodeltest.h:13
SsuFeatureModelPrivate
Definition: ssufeaturemodel.cpp:21
SsuFeatureModel
Definition: ssufeaturemodel.h:16