mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-01-15 15:19:55 +00:00
d03722b3f4
(cherry picked from commits5c79e7106f
,57353cdfff
,15723adb9a
,01a5196a92
,ed75563a94
,3839a2dcfd
,1fd16ba69c
,66283943c5
,ba8613a179
,5b8f4f3e92
,35b771b19e
,043eb224e2
,05fac2f67d
)
46 lines
904 B
C++
46 lines
904 B
C++
//
|
|
// Created by koncord on 27.05.17.
|
|
//
|
|
|
|
|
|
#ifndef OPENMW_QUERYHELPER_HPP
|
|
#define OPENMW_QUERYHELPER_HPP
|
|
|
|
|
|
#include <QObject>
|
|
#include <vector>
|
|
#include <QAbstractItemModel>
|
|
#include <components/openmw-mp/Master/MasterData.hpp>
|
|
|
|
Q_DECLARE_METATYPE(QueryData)
|
|
|
|
class QueryHelper : public QObject
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
explicit QueryHelper(QAbstractItemModel *model);
|
|
public slots:
|
|
void refresh();
|
|
void terminate();
|
|
private slots:
|
|
void update(const QString &addr, unsigned short port, const QueryData& data);
|
|
signals:
|
|
void finished();
|
|
void started();
|
|
private:
|
|
QThread *queryThread;
|
|
QAbstractItemModel *_model;
|
|
};
|
|
|
|
class QueryUpdate : public QObject
|
|
{
|
|
friend class QueryHelper;
|
|
Q_OBJECT
|
|
signals:
|
|
void finished();
|
|
void updateModel(const QString &addr, unsigned short port, const QueryData& data);
|
|
public slots:
|
|
void process();
|
|
};
|
|
|
|
#endif //OPENMW_QUERYHELPER_HPP
|