FileTrans/mainwindow.h

40 lines
649 B
C++

#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QSettings>
#include <QTcpServer>
#include <QTcpSocket>
#include <QFile>
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = nullptr);
~MainWindow();
private:
Ui::MainWindow *ui;
QSettings settings;
QString IP, path;
QTcpServer *tcpServer;
QTcpSocket *tcpSocket;
int state;
QFile file;
qint64 length;
QString BS(long b);
void upload(QString filepath);
private slots:
void newConnect();
void readyRead();
};
#endif // MAINWINDOW_H