subsurface/core/connectionlistmodel.h
Rolf Eike Beer bf9a526d63 slightly optimize ConnectionListModel
-avoid object copies
-use some more bullet proof C++11 constructs
-avoid using a QRegExp, simple string matches are faster

Signed-off-by: Rolf Eike Beer <eike@sf-mail.de>
2019-03-27 07:36:33 -07:00

19 lines
515 B
C++

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