mirror of
https://github.com/ysoftdevs/Testa.git
synced 2026-01-17 08:56:40 +01:00
Added action receiver, refactored controller, extracted parsing logic from controller
This commit is contained in:
29
actionreceiver.h
Normal file
29
actionreceiver.h
Normal file
@@ -0,0 +1,29 @@
|
||||
#ifndef ACTIONRECEIVER_H
|
||||
#define ACTIONRECEIVER_H
|
||||
|
||||
#include <QObject>
|
||||
#include <QtWebSockets>
|
||||
|
||||
class ActionReceiver : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
explicit ActionReceiver(const QUrl &address, QObject *parent = 0);
|
||||
~ActionReceiver();
|
||||
private slots:
|
||||
void socketConnected();
|
||||
void socketReceivedStringMessage(const QString &message);
|
||||
void socketError(QAbstractSocket::SocketError socketError);
|
||||
signals:
|
||||
void loadUrlReceived(QString);
|
||||
void setProgressReceived(float);
|
||||
void showNotificationReceived(QString, QString);
|
||||
private:
|
||||
QUrl address;
|
||||
QWebSocket* webSocket;
|
||||
|
||||
QString getActionType(const QJsonObject &jsonObject);
|
||||
QJsonObject getParameters(const QJsonObject &jsonObject);
|
||||
};
|
||||
|
||||
#endif // ACTIONRECEIVER_H
|
||||
Reference in New Issue
Block a user