mirror of
https://github.com/subsurface/subsurface.git
synced 2024-12-11 03:21:29 +00:00
1bbbc07dd5
This will allow us to programatically set the connection in the QML UI. Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
24 lines
620 B
C++
24 lines
620 B
C++
#ifndef CONNECTIONLISTMODEL_H
|
|
#define CONNECTIONLISTMODEL_H
|
|
|
|
#include <QAbstractListModel>
|
|
|
|
class ConnectionListModel : public QAbstractListModel {
|
|
Q_OBJECT
|
|
public:
|
|
enum CLMRole {
|
|
AddressRole = Qt::UserRole + 1
|
|
};
|
|
ConnectionListModel(QObject *parent = 0);
|
|
QHash<int, QByteArray> roleNames() const;
|
|
QVariant data(const QModelIndex &index, int role = AddressRole) const;
|
|
QString address(int idx) const;
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
|
void addAddress(const QString address);
|
|
void removeAllAddresses();
|
|
int indexOf(QString address);
|
|
private:
|
|
QStringList m_addresses;
|
|
};
|
|
|
|
#endif
|