now works on windows
This commit is contained in:
2026-02-14 14:32:50 +01:00
parent b493129184
commit 9765cd3e51
12 changed files with 127 additions and 49 deletions
+23 -2
View File
@@ -1,6 +1,13 @@
#pragma once
#include <QObject>
#include <nlohmann/json.hpp>
#ifdef INTERNAL
#define EXPORT Q_DECL_EXPORT
#else
#define EXPORT Q_DECL_IMPORT
#endif
Q_FORWARD_DECLARE_OBJC_CLASS(QWebSocket);
Q_FORWARD_DECLARE_OBJC_CLASS(QTimer);
using json = nlohmann::json;
@@ -9,7 +16,7 @@ using json = nlohmann::json;
* @brief Class wrapping a WebSocket connection
*
*/
class Web_socket_wrapper : public QObject
class EXPORT Web_socket_wrapper : public QObject
{
Q_OBJECT
public:
@@ -27,6 +34,18 @@ class Web_socket_wrapper : public QObject
begin = 0
};
enum class Log_level_enum : int
{
trace,
debug,
info,
warn,
err,
critical,
off,
n_levels
};
/**
* @brief Enumeration of events
*
@@ -121,7 +140,7 @@ class Web_socket_wrapper : public QObject
*/
void inhibit_events(bool inhibit);
Q_SIGNALS:
signals:
/**
* @brief Signal emitted when the WebSocket is connected
*
@@ -145,6 +164,8 @@ class Web_socket_wrapper : public QObject
*/
void on_event_cb(json &data);
void log_signal(const char *filename_in, int line_in, const char *funcname_in, int level, QString msg);
private Q_SLOTS:
/**
* @brief Internal slot for handling WebSocket connection established