mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-10-30 12:26:41 +00:00
(cherry picked from commits5c79e7106f,57353cdfff,15723adb9a,01a5196a92,ed75563a94,3839a2dcfd,1fd16ba69c,66283943c5,ba8613a179,5b8f4f3e92,35b771b19e,043eb224e2,05fac2f67d)
51 lines
1.4 KiB
C++
51 lines
1.4 KiB
C++
#ifndef SERVERMODEL_FONTMODEL_HPP
|
|
#define SERVERMODEL_FONTMODEL_HPP
|
|
|
|
#include <QObject>
|
|
#include <vector>
|
|
#include <QString>
|
|
#include <QAbstractTableModel>
|
|
#include <components/openmw-mp/Master/MasterData.hpp>
|
|
|
|
struct ServerData : public QueryData
|
|
{
|
|
QString addr;
|
|
int ping;
|
|
enum IDS
|
|
{
|
|
ADDR,
|
|
HOSTNAME,
|
|
PLAYERS,
|
|
MAX_PLAYERS,
|
|
PASSW,
|
|
MODNAME,
|
|
PING,
|
|
VERSION,
|
|
LAST
|
|
};
|
|
};
|
|
|
|
class ServerModel: public QAbstractTableModel
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit ServerModel(QObject *parent = nullptr);
|
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const Q_DECL_FINAL;
|
|
int rowCount(const QModelIndex &parent = QModelIndex()) const Q_DECL_FINAL;
|
|
int columnCount(const QModelIndex &parent) const Q_DECL_FINAL;
|
|
bool setData(const QModelIndex &index, const QVariant &value, int role = Qt::EditRole) Q_DECL_FINAL;
|
|
|
|
bool insertRows(int row, int count, const QModelIndex &index = QModelIndex()) Q_DECL_FINAL;
|
|
bool removeRows(int row, int count, const QModelIndex &parent = QModelIndex()) Q_DECL_FINAL;
|
|
|
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const Q_DECL_FINAL;
|
|
QModelIndex index(int row, int column, const QModelIndex &parent = QModelIndex()) const Q_DECL_FINAL;
|
|
|
|
|
|
public:
|
|
//QHash<int, QByteArray> roles;
|
|
QVector<ServerData> myData;
|
|
};
|
|
|
|
|
|
#endif //SERVERMODEL_FONTMODEL_HPP
|