1
0
forked from blue/squawk
squawk/ui/models/accounts.h

34 lines
820 B
C
Raw Normal View History

2019-03-30 20:13:13 +00:00
#ifndef MODELS_ACCOUNTS_H
#define MODELS_ACCOUNTS_H
#include <qabstractitemmodel.h>
#include <deque>
namespace Models
{
class Accounts : public QAbstractTableModel
{
Q_OBJECT
public:
Accounts(QObject* parent = 0);
~Accounts();
void addAccount(const QMap<QString, QVariant>& map);
2019-04-02 15:46:18 +00:00
void updateAccount(const QString& account, const QString& field, const QVariant& value);
2019-03-30 20:13:13 +00:00
QVariant data ( const QModelIndex& index, int role ) const override;
int columnCount ( const QModelIndex& parent ) const override;
int rowCount ( const QModelIndex& parent ) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
private:
2019-04-03 15:09:29 +00:00
std::deque<Account*> accs;
2019-03-30 20:13:13 +00:00
static std::deque<QString> columns;
};
}
#endif // MODELS_ACCOUNT_H