Commit c69ca4df80c9c74aa842b7f1fb3c44b22ae3232e 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>
21 lines
567 B
C++
21 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
|