LocalJsonClient.h 528 B

1234567891011121314151617181920212223242526
  1. //
  2. // Created by Tobias Hieta on 30/08/15.
  3. //
  4. #ifndef KONVERGO_LOCALJSONCLIENT_H
  5. #define KONVERGO_LOCALJSONCLIENT_H
  6. #include <QLocalSocket>
  7. class LocalJsonClient : public QLocalSocket
  8. {
  9. Q_OBJECT
  10. public:
  11. explicit LocalJsonClient(const QString serverPath, QObject* parent = nullptr);
  12. void connectToServer();
  13. bool sendMessage(const QVariantMap& message);
  14. Q_SIGNALS:
  15. void messageReceived(const QVariantMap& message);
  16. private:
  17. Q_SLOT void readyRead();
  18. QString m_serverPath;
  19. };
  20. #endif //KONVERGO_LOCALJSONCLIENT_H