subsurface/core/connectionlistmodel.h
Berthold Stoeger 15b2dbede4 Mobile: reinstate roleNames function in ConnectionListModel
Commit c69ca4df80 removed the roleNames
function, which is not needed according to the docs, as a default function
is provided. For unknown reasons this broke the QML combo box.

Reinstate the function.

Signed-off-by: Berthold Stoeger <bstoeger@mail.tuwien.ac.at>
2019-04-16 23:43:14 +12:00

20 lines
567 B
C++

#ifndef CONNECTIONLISTMODEL_H
#define CONNECTIONLISTMODEL_H
#include <QAbstractListModel>
class ConnectionListModel : public QAbstractListModel {
Q_OBJECT
public:
ConnectionListModel(QObject *parent = nullptr);
QHash<int, QByteArray> roleNames() const override;
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