2017-10-06 07:51:30 -07:00
|
|
|
#ifndef CONNECTIONLISTMODEL_H
|
|
|
|
#define CONNECTIONLISTMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
|
|
|
class ConnectionListModel : public QAbstractListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-03-22 21:25:59 +01:00
|
|
|
ConnectionListModel(QObject *parent = nullptr);
|
2019-04-16 09:47:28 +02:00
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
2019-03-22 21:25:59 +01:00
|
|
|
QVariant data(const QModelIndex &index, int role) const override;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
|
|
|
void addAddress(const QString &address);
|
2017-10-11 19:31:45 +02:00
|
|
|
void removeAllAddresses();
|
2019-03-22 21:25:59 +01:00
|
|
|
int indexOf(const QString &address) const;
|
2017-10-06 07:51:30 -07:00
|
|
|
private:
|
|
|
|
QStringList m_addresses;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|