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 SENDER_H
|
|
|
|
#define SENDER_H
|
|
|
|
|
2011-04-27 17:16:41 +00:00
|
|
|
#include <QWidget>
|
2017-09-20 13:56:31 +00:00
|
|
|
#include <QTimer>
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QLabel;
|
|
|
|
class QPushButton;
|
|
|
|
class QUdpSocket;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
2011-04-27 17:16:41 +00:00
|
|
|
class Sender : public QWidget
|
2011-04-27 10:05:43 +00:00
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2017-09-20 13:56:31 +00:00
|
|
|
explicit Sender(QWidget *parent = nullptr);
|
2011-04-27 10:05:43 +00:00
|
|
|
|
|
|
|
private slots:
|
|
|
|
void startBroadcasting();
|
|
|
|
void broadcastDatagram();
|
|
|
|
|
|
|
|
private:
|
2017-09-20 13:56:31 +00:00
|
|
|
QLabel *statusLabel = nullptr;
|
|
|
|
QPushButton *startButton = nullptr;
|
|
|
|
QUdpSocket *udpSocket = nullptr;
|
|
|
|
QTimer timer;
|
|
|
|
int messageNo = 1;
|
2011-04-27 10:05:43 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|