2022-05-10 10:06:48 +00:00
|
|
|
// Copyright (C) 2017 The Qt Company Ltd.
|
|
|
|
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
#ifndef SERVER_H
|
|
|
|
#define SERVER_H
|
|
|
|
|
|
|
|
#include <QDialog>
|
2017-09-27 10:32:34 +00:00
|
|
|
#include <QString>
|
2020-06-22 08:12:38 +00:00
|
|
|
#include <QList>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QLabel;
|
|
|
|
class QTcpServer;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
//! [0]
|
|
|
|
class Server : public QDialog
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-27 10:32:34 +00:00
|
|
|
explicit Server(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void sendFortune();
|
|
|
|
|
|
|
|
private:
|
2020-02-14 15:35:01 +00:00
|
|
|
void initServer();
|
|
|
|
|
2017-09-27 10:32:34 +00:00
|
|
|
QLabel *statusLabel = nullptr;
|
|
|
|
QTcpServer *tcpServer = nullptr;
|
2020-06-22 08:12:38 +00:00
|
|
|
QList<QString> fortunes;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
//! [0]
|
|
|
|
|
|
|
|
#endif
|