mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-31 21:03:23 +00:00
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>
This commit is contained in:
parent
aa86d47e47
commit
15b2dbede4
2 changed files with 8 additions and 0 deletions
|
@ -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())
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Add table
Reference in a new issue