Files
amnezia-client/client/ui/models/allowedDnsModel.h
T

32 lines
669 B
C++
Raw Normal View History

2025-05-02 23:54:36 -07:00
#ifndef ALLOWEDDNSMODEL_H
#define ALLOWEDDNSMODEL_H
#include <QAbstractListModel>
#include <QStringList>
2025-05-02 23:54:36 -07:00
class AllowedDnsModel : public QAbstractListModel
{
Q_OBJECT
public:
enum Roles {
IpRole = Qt::UserRole + 1
};
explicit AllowedDnsModel(QObject *parent = nullptr);
2025-05-02 23:54:36 -07:00
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
public slots:
void updateModel(const QStringList &dnsServers);
2025-05-02 23:54:36 -07:00
protected:
QHash<int, QByteArray> roleNames() const override;
private:
QStringList m_dnsServers;
};
#endif // ALLOWEDDNSMODEL_H