2017-10-06 14:51:30 +00:00
|
|
|
#ifndef CONNECTIONLISTMODEL_H
|
|
|
|
#define CONNECTIONLISTMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
|
|
|
class ConnectionListModel : public QAbstractListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2019-03-22 20:25:59 +00:00
|
|
|
ConnectionListModel(QObject *parent = nullptr);
|
2019-04-16 07:47:28 +00:00
|
|
|
QHash<int, QByteArray> roleNames() const override;
|
2019-03-22 20:25:59 +00: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 17:31:45 +00:00
|
|
|
void removeAllAddresses();
|
2019-03-22 20:25:59 +00:00
|
|
|
int indexOf(const QString &address) const;
|
2017-10-06 14:51:30 +00:00
|
|
|
private:
|
|
|
|
QStringList m_addresses;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|