-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathserverstablemodel.h
45 lines (33 loc) · 1.31 KB
/
serverstablemodel.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
* Copyright 2020 Sinodun Internet Technologies Ltd.
*
* This Source Code Form is subject to the terms of the Mozilla Public
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, you can obtain one at https://mozilla.org/MPL/2.0/.
*/
#ifndef PROFILESERVERSTABLEMODEL_H
#define PROFILESERVERSTABLEMODEL_H
#include <QAbstractTableModel>
#include "configmanager.h"
class ServersTableModel : public QAbstractTableModel
{
Q_OBJECT
public:
ServersTableModel(Config& config, Config::NetworkProfile networkProfile, QObject* parent = NULL);
virtual ~ServersTableModel();
int rowCount(const QModelIndex& parent = QModelIndex()) const;
int columnCount(const QModelIndex& parent = QModelIndex()) const;
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
Qt::ItemFlags flags(const QModelIndex& index) const;
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const;
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole);
void STPConfigChanged();
private:
void serverFromRow(int row, int& serverIndex, int& addressIndex) const;
Config& m_config;
Config::NetworkProfile m_networkProfile;
};
#endif
/* Local Variables: */
/* mode: c++ */
/* End: */