client.h 529 B

1234567891011121314151617181920212223242526272829
  1. #ifndef CLIENT_H
  2. #define CLIENT_H
  3. #include <QObject>
  4. #include <QtWebSockets/QtWebSockets>
  5. #include <QDebug>
  6. class client : public QObject
  7. {
  8. Q_OBJECT
  9. public:
  10. QWebSocket m_webSocket;
  11. QUrl m_url;
  12. QString msg;
  13. explicit client(QObject *parent = nullptr, QUrl url = QStringLiteral("ws://localhost:1235"));
  14. signals:
  15. void closed();
  16. public slots:
  17. void SlotSendStyleToSim(QString newstyle);
  18. private slots:
  19. void onConnected();
  20. void onTextMessageReceived(QString message);
  21. };
  22. #endif // CLIENT_H