summaryrefslogtreecommitdiffstats
path: root/core/connectionlistmodel.h
blob: 11a93bfbc2b3e0174610138c5515f04cc3ac0f61 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#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);
	void removeAllAddresses();
	int indexOf(QString address);
private:
	QStringList m_addresses;
};

#endif