2017-10-06 14:51:30 +00:00
|
|
|
#ifndef CONNECTIONLISTMODEL_H
|
|
|
|
#define CONNECTIONLISTMODEL_H
|
|
|
|
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
|
|
|
|
class ConnectionListModel : public QAbstractListModel {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
enum CLMRole {
|
|
|
|
AddressRole = Qt::UserRole + 1
|
|
|
|
};
|
|
|
|
ConnectionListModel(QObject *parent = 0);
|
|
|
|
QHash<int, QByteArray> roleNames() const;
|
|
|
|
QVariant data(const QModelIndex &index, int role = AddressRole) const;
|
|
|
|
QString address(int idx) const;
|
|
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
|
|
void addAddress(const QString address);
|
2017-10-11 17:31:45 +00:00
|
|
|
void removeAllAddresses();
|
2018-08-08 12:54:10 +00:00
|
|
|
int indexOf(QString address);
|
2017-10-06 14:51:30 +00:00
|
|
|
private:
|
|
|
|
QStringList m_addresses;
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|