mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
core: add indexOf member to ConnectionListModel
This will allow us to programatically set the connection in the QML UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
842210c80d
commit
1bbbc07dd5
2 changed files with 6 additions and 0 deletions
|
@ -50,3 +50,8 @@ void ConnectionListModel::removeAllAddresses()
|
|||
m_addresses.clear();
|
||||
endRemoveRows();
|
||||
}
|
||||
|
||||
int ConnectionListModel::indexOf(QString address)
|
||||
{
|
||||
return m_addresses.indexOf(address);
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ public:
|
|||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
void addAddress(const QString address);
|
||||
void removeAllAddresses();
|
||||
int indexOf(QString address);
|
||||
private:
|
||||
QStringList m_addresses;
|
||||
};
|
||||
|
|
Loading…
Add table
Reference in a new issue