add account support

Co-authored-by: kenshi84 <kenshi84@protonmail.ch>
This commit is contained in:
selsta
2019-01-14 13:25:59 +01:00
parent 9689fff957
commit bd809abc52
17 changed files with 654 additions and 7 deletions

View File

@@ -0,0 +1,36 @@
#ifndef SUBADDRESSACCOUNTMODEL_H
#define SUBADDRESSACCOUNTMODEL_H
#include <QAbstractListModel>
class SubaddressAccount;
class SubaddressAccountModel : public QAbstractListModel
{
Q_OBJECT
public:
enum SubaddressAccountRowRole {
SubaddressAccountRole = Qt::UserRole + 1, // for the SubaddressAccountRow object;
SubaddressAccountAddressRole,
SubaddressAccountLabelRole,
SubaddressAccountBalanceRole,
SubaddressAccountUnlockedBalanceRole,
};
Q_ENUM(SubaddressAccountRowRole)
SubaddressAccountModel(QObject *parent, SubaddressAccount *subaddressAccount);
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QHash<int, QByteArray> roleNames() const override;
public slots:
void startReset();
void endReset();
private:
SubaddressAccount *m_subaddressAccount;
};
#endif // SUBADDRESSACCOUNTMODEL_H