qt_demoe/tool/nettool/form/frmtcpserver.h

53 lines
1.1 KiB
C
Raw Normal View History

2019-09-29 05:13:01 +00:00
#ifndef FRMTCPSERVER_H
#define FRMTCPSERVER_H
#include <QWidget>
#include "tcpserver.h"
namespace Ui {
class frmTcpServer;
}
class frmTcpServer : public QWidget
{
Q_OBJECT
public:
explicit frmTcpServer(QWidget *parent = 0);
~frmTcpServer();
2021-08-22 02:57:02 +00:00
protected:
bool eventFilter(QObject *watched, QEvent *event);
2019-09-29 05:13:01 +00:00
private:
Ui::frmTcpServer *ui;
2019-09-29 05:13:01 +00:00
bool isOk;
TcpServer *server;
2019-09-29 05:13:01 +00:00
QTimer *timer;
private slots:
void initForm();
2019-09-29 05:13:01 +00:00
void initConfig();
void saveConfig();
void initTimer();
2019-09-29 05:13:01 +00:00
void append(int type, const QString &data, bool clear = false);
private slots:
2021-08-22 02:57:02 +00:00
void connected(const QString &ip, int port);
void disconnected(const QString &ip, int port);
void error(const QString &ip, int port, const QString &error);
2019-09-29 05:13:01 +00:00
void sendData(const QString &ip, int port, const QString &data);
void receiveData(const QString &ip, int port, const QString &data);
2019-09-29 05:13:01 +00:00
private slots:
void on_btnListen_clicked();
void on_btnSave_clicked();
void on_btnClear_clicked();
void on_btnSend_clicked();
2021-08-22 02:57:02 +00:00
void on_btnRemove_clicked();
2019-09-29 05:13:01 +00:00
};
#endif // FRMTCPSERVER_H