qt5base-lts/examples/network/loopback/dialog.h
Lucie Gérard 05fc3aef53 Use SPDX license identifiers
Replace the current license disclaimer in files by
a SPDX-License-Identifier.
Files that have to be modified by hand are modified.
License files are organized under LICENSES directory.

Task-number: QTBUG-67283
Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
2022-05-16 16:37:38 +02:00

52 lines
1.1 KiB
C++

// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QTcpServer>
#include <QTcpSocket>
QT_BEGIN_NAMESPACE
class QDialogButtonBox;
class QLabel;
class QProgressBar;
class QPushButton;
QT_END_NAMESPACE
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = nullptr);
public slots:
void start();
void acceptConnection();
void startTransfer();
void updateServerProgress();
void updateClientProgress(qint64 numBytes);
void displayError(QAbstractSocket::SocketError socketError);
private:
QProgressBar *clientProgressBar = nullptr;
QProgressBar *serverProgressBar = nullptr;
QLabel *clientStatusLabel = nullptr;
QLabel *serverStatusLabel = nullptr;
QPushButton *startButton = nullptr;
QPushButton *quitButton = nullptr;
QDialogButtonBox *buttonBox = nullptr;
QTcpServer tcpServer;
QTcpSocket tcpClient;
QTcpSocket *tcpServerConnection = nullptr;
int bytesToWrite = 0;
int bytesWritten = 0;
int bytesReceived = 0;
};
#endif