This commit is contained in:
2026-09-30 12:33:21 +02:00
parent 08fd5407c3
commit 67d7e959b1
14 changed files with 353 additions and 711 deletions
+4 -4
View File
@@ -9,7 +9,7 @@
class UIFactory
{
public:
using Creator = std::function<UI_base *(Web_socket_wrapper *web_socket, QWidget *)>;
using Creator = std::function<UI_base *(RemoteUiService::Client *s, QWidget *)>;
static UIFactory &instance()
{
@@ -25,12 +25,12 @@ class UIFactory
return true;
}
UI_base *create(const QString &key, Web_socket_wrapper *w, QWidget *parent = nullptr) const
UI_base *create(const QString &key, RemoteUiService::Client *s, QWidget *parent = nullptr) const
{
auto it = m_creators.constFind(key);
if (it == m_creators.cend())
return nullptr;
return it.value()(w, parent);
return it.value()(s, parent);
}
QStringList keys() const
@@ -50,7 +50,7 @@ class UIFactory
Register##TYPE() \
{ \
UIFactory::instance().registerType(TYPE::name(), \
[](Web_socket_wrapper *w, QWidget *p) { return new TYPE(w, p); }); \
[](RemoteUiService::Client *s, QWidget *p) { return new TYPE(s, p); }); \
} \
}; \
static Register##TYPE register_##TYPE; \