diff options
Diffstat (limited to 'core')
-rw-r--r-- | core/connectionlistmodel.cpp | 7 | ||||
-rw-r--r-- | core/connectionlistmodel.h | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/core/connectionlistmodel.cpp b/core/connectionlistmodel.cpp index 0e4d69828..e4ac8bfeb 100644 --- a/core/connectionlistmodel.cpp +++ b/core/connectionlistmodel.cpp @@ -7,6 +7,13 @@ ConnectionListModel::ConnectionListModel(QObject *parent) : { } +QHash <int, QByteArray> ConnectionListModel::roleNames() const +{ + QHash<int, QByteArray> roles; + roles[Qt::DisplayRole] = "display"; + return roles; +} + QVariant ConnectionListModel::data(const QModelIndex &index, int role) const { if (index.row() < 0 || index.row() >= m_addresses.count()) diff --git a/core/connectionlistmodel.h b/core/connectionlistmodel.h index d05b753c7..75bf9c7d6 100644 --- a/core/connectionlistmodel.h +++ b/core/connectionlistmodel.h @@ -7,6 +7,7 @@ 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); |