~mterry/+junk/u8.2

« back to all changes in this revision

Viewing changes to tests/mocks/Unity/Indicators/fakeindicatorsmodel.h

  • Committer: Michael Terry
  • Date: 2014-11-17 14:56:04 UTC
  • mfrom: (1317.1.118 unity8)
  • Revision ID: michael.terry@canonical.com-20141117145604-96dn9p5nwkifq2f4
MergeĀ fromĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
    Q_ENUMS(Roles)
29
29
    Q_PROPERTY(int count READ count NOTIFY countChanged)
30
30
    Q_PROPERTY(QString profile READ profile WRITE setProfile NOTIFY profileChanged)
 
31
    Q_PROPERTY(QVariant modelData READ modelData WRITE setModelData NOTIFY modelDataChanged)
 
32
 
31
33
public:
32
34
 
33
35
    FakeIndicatorsModel(QObject *parent=0);
37
39
    Q_INVOKABLE void unload();
38
40
 
39
41
    Q_INVOKABLE void append(const QVariantMap& row);
 
42
    Q_INVOKABLE void insert(int row, const QVariantMap& data);
 
43
    Q_INVOKABLE void remove(int row);
40
44
 
41
45
    Q_INVOKABLE QVariant data(int row, int role) const;
42
46
 
43
47
    QString profile() const;
44
48
    void setProfile(const QString& profile);
 
49
    void setModelData(const QVariant& data);
 
50
    QVariant modelData() const { return m_modelData; }
45
51
 
46
52
    /* QAbstractItemModel */
47
53
    QHash<int, QByteArray> roleNames() const;
53
59
Q_SIGNALS:
54
60
    void countChanged();
55
61
    void profileChanged();
 
62
    void modelDataChanged();
56
63
 
57
64
private:
58
65
    int count() const;
59
66
 
60
 
    typedef QHash<int, QVariant> Indicator;
61
 
    QList<Indicator*> m_indicators;
62
67
    QString m_profile;
 
68
    QVariant m_modelData;
63
69
};
64
70
 
65
71
#endif // FAKE_INDICATORSMODEL_H