2022-02-22 08:02:34 +00:00
|
|
|
#pragma once
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
#include <QHash>
|
|
|
|
#include <QVector>
|
|
|
|
|
|
|
|
#include "item.h"
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
namespace Modules::Main::Wallet::Accounts
|
2022-02-14 14:38:41 +00:00
|
|
|
{
|
|
|
|
class Model : public QAbstractListModel
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
|
|
|
enum ModelRole
|
|
|
|
{
|
|
|
|
Name = Qt::UserRole + 1,
|
|
|
|
Address,
|
|
|
|
Path,
|
|
|
|
Color,
|
|
|
|
PublicKey,
|
|
|
|
WalletType,
|
|
|
|
IsWallet,
|
|
|
|
IsChat,
|
|
|
|
Assets,
|
|
|
|
CurrencyBalance
|
|
|
|
};
|
|
|
|
|
|
|
|
explicit Model(QObject* parent = nullptr);
|
|
|
|
|
2022-02-16 21:51:04 +00:00
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
|
|
|
int rowCount(const QModelIndex&) const override;
|
|
|
|
QVariant data(const QModelIndex& index, int role) const override;
|
2022-02-21 17:07:16 +00:00
|
|
|
void setItems(const QVector<Item*>& items);
|
|
|
|
Item* getItemByIndex(int index) const;
|
2022-02-14 14:38:41 +00:00
|
|
|
|
|
|
|
private:
|
2022-02-21 17:07:16 +00:00
|
|
|
QVector<Item*> m_items;
|
2022-02-14 14:38:41 +00:00
|
|
|
};
|
2022-02-16 21:51:04 +00:00
|
|
|
} // namespace Modules::Main::Wallet::Accounts
|