mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-01 04:33:24 +00:00
c69ca4df80
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>
19 lines
477 B
C++
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
|