mythread.h 439 B

12345678910111213141516171819202122
  1. #ifndef MYTHREAD_H
  2. #define MYTHREAD_H
  3. #include<QThread>
  4. #include <QDebug>
  5. #include <QTcpServer> //监听套接字
  6. #include <QTcpSocket> //通信套接字//对方的(客户端的)套接字(通信套接字)
  7. class MyThread : public QThread
  8. {
  9. Q_OBJECT
  10. public:
  11. explicit MyThread(QObject *parent = nullptr);
  12. void run() override; //线程处理函数
  13. signals:
  14. void sign_stop(); //线程结束信号
  15. };
  16. #endif // MYTHREAD_H