summaryrefslogtreecommitdiffstats
path: root/framework/domain/accountsmodel.h
diff options
context:
space:
mode:
Diffstat (limited to 'framework/domain/accountsmodel.h')
-rw-r--r--framework/domain/accountsmodel.h17
1 files changed, 11 insertions, 6 deletions
diff --git a/framework/domain/accountsmodel.h b/framework/domain/accountsmodel.h
index a50c2e4a..9180bc09 100644
--- a/framework/domain/accountsmodel.h
+++ b/framework/domain/accountsmodel.h
@@ -20,11 +20,15 @@
20#pragma once 20#pragma once
21 21
22#include <QObject> 22#include <QObject>
23#include <QAbstractListModel> 23#include <QIdentityProxyModel>
24#include <QSharedPointer> 24#include <QSharedPointer>
25#include <QStringList> 25#include <QStringList>
26 26
27class AccountsModel : public QAbstractListModel 27namespace Sink {
28 class Query;
29}
30
31class AccountsModel : public QIdentityProxyModel
28{ 32{
29 Q_OBJECT 33 Q_OBJECT
30 34
@@ -32,8 +36,7 @@ public:
32 AccountsModel(QObject *parent = Q_NULLPTR); 36 AccountsModel(QObject *parent = Q_NULLPTR);
33 ~AccountsModel(); 37 ~AccountsModel();
34 38
35 int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_OVERRIDE; 39 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
36 QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_OVERRIDE;
37 40
38 enum Roles { 41 enum Roles {
39 Name = Qt::UserRole + 1, 42 Name = Qt::UserRole + 1,
@@ -42,7 +45,9 @@ public:
42 }; 45 };
43 Q_ENUMS(Roles) 46 Q_ENUMS(Roles)
44 47
45 QHash<int, QByteArray> roleNames() const Q_DECL_OVERRIDE; 48 QHash<int, QByteArray> roleNames() const;
49
46private: 50private:
47 QStringList mAccounts; 51 void runQuery(const Sink::Query &query);
52 QSharedPointer<QAbstractItemModel> mModel;
48}; 53};