Rabbit Remote Control 0.0.30
Loading...
Searching...
No Matches
WakeOnLanModel.h
1#ifndef WAKEONLANMODEL_H
2#define WAKEONLANMODEL_H
3
4#include <QAbstractTableModel>
5#include <QSharedPointer>
6#include <vector>
7
8#include "ParameterWakeOnLan.h"
9
10class CWakeOnLanModel : public QAbstractTableModel
11{
12 Q_OBJECT
13public:
14 explicit CWakeOnLanModel(QObject *parent = nullptr);
15 virtual ~CWakeOnLanModel();
16
17 int AddItem(QSharedPointer<CParameterWakeOnLan> para);
18 int Load(QSettings &set, CParameterClient *pClient);
19 int Save(QSettings &set);
20
21 QSharedPointer<CParameterWakeOnLan> GetData(const QModelIndex &index);
22
23 // QAbstractItemModel interface
24public:
25 virtual int rowCount(const QModelIndex &parent) const override;
26 virtual int columnCount(const QModelIndex &parent) const override;
27 virtual QVariant data(const QModelIndex &index, int role) const override;
28 virtual bool setData(const QModelIndex &index, const QVariant &value, int role) override;
29 virtual QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
30 virtual Qt::ItemFlags flags(const QModelIndex &index) const override;
31 virtual bool removeRows(int row, int count, const QModelIndex &parent) override;
32 virtual void sort(int column, Qt::SortOrder order) override;
33
34 std::vector<QSharedPointer<CParameterWakeOnLan> > m_Data;
35 QMap<int, Qt::SortOrder> m_Sort;
36
37private Q_SLOTS:
38 void slotHostStateChanged();
39
40private:
41 int m_Colume;
42};
43
44#endif // WAKEONLANMODEL_H
The parameters of client.