1// Copyright (C) 2021 The Qt Company Ltd.
2// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR GPL-3.0-only
3
4#ifndef RESOURCESERVER_H
5#define RESOURCESERVER_H
6
7#include "message.h"
8
9#include <QtCore/qstring.h>
10#include <QtCore/qpointer.h>
11
12#include <QtNetwork/qlocalserver.h>
13#include <QtNetwork/qlocalsocket.h>
14
15QT_BEGIN_NAMESPACE
16
17class ResourceServer : public QObject
18{
19 Q_OBJECT
20public:
21 ResourceServer(const QString &serverName);
22 bool init();
23
24Q_SIGNALS:
25 void messageReceived(Message::MessagePtr message);
26
27public Q_SLOTS:
28 void sendMessage(const Message::MessagePtr &message);
29
30private:
31 QString m_serverName;
32 QLocalServer m_server;
33 QPointer<QLocalSocket> m_connection;
34};
35
36QT_END_NAMESPACE
37
38#endif // RESOURCESERVER_H
39

source code of qtquick3d/tools/materialeditor/resourceserver.h