subsurface/core/connectionlistmodel.h
Dirk Hohndel c69ca4df80 Core: simplify ConnectionListModel
The complicated setup with the AddressRole is unnecessary. All we want to be
able to do is get the index of a specific text in the list. In hindsight I am
puzzled why I implemented this in such a complex fashion.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
2019-03-20 09:07:17 -07:00

19 lines
477 B
C++

#ifndef CONNECTIONLISTMODEL_H
#define CONNECTIONLISTMODEL_H
#include <QAbstractListModel>
class ConnectionListModel : public QAbstractListModel {
Q_OBJECT
public:
ConnectionListModel(QObject *parent = 0);
QVariant data(const QModelIndex &index, int role) const;
int rowCount(const QModelIndex &parent = QModelIndex()) const;
void addAddress(const QString address);
void removeAllAddresses();
int indexOf(QString address);
private:
QStringList m_addresses;
};
#endif