-
Notifications
You must be signed in to change notification settings - Fork 75
Expand file tree
/
Copy pathNodeModel.h
More file actions
40 lines (30 loc) · 964 Bytes
/
NodeModel.h
File metadata and controls
40 lines (30 loc) · 964 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
// SPDX-License-Identifier: BSD-3-Clause
// SPDX-FileCopyrightText: The Monero Project
#ifndef FEATHER_NODEMODEL_H
#define FEATHER_NODEMODEL_H
#include <QAbstractTableModel>
#include <QIcon>
class FeatherNode;
class NodeModel : public QAbstractTableModel {
Q_OBJECT
public:
enum ModelColumn {
URL,
Height,
COUNT
};
explicit NodeModel(int nodeSource, QObject *parent = nullptr);
int rowCount(const QModelIndex &parent) const override;
int columnCount(const QModelIndex &parent) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
FeatherNode node(int row);
void clear();
void updateNodes(QList<FeatherNode> nodes);
private:
QList<FeatherNode> m_nodes;
int m_nodeSource;
QIcon m_offline;
QIcon m_online;
};
#endif //FEATHER_NODEMODEL_H