mirror of
https://github.com/subsurface/subsurface.git
synced 2025-02-19 22:16:15 +00:00
Move ConnectionListModel into its own source file
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
030c094854
commit
7aacaf60da
7 changed files with 69 additions and 57 deletions
22
core/connectionlistmodel.h
Normal file
22
core/connectionlistmodel.h
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
#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);
|
||||
private:
|
||||
QStringList m_addresses;
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue