没有事情做 随手写的小程序

本文详细介绍了使用Qt创建一个包含多个mythread子类的对话框,每个子线程通过UdpSocket发送数据到指定端口。同时,讨论了如何在按钮点击事件中启动和停止这些线程。文章最后提到了对535353端口可能的攻击行为的警示。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

Qt  代码包  https://download.youkuaiyun.com/download/nn_84/88830445

dialog.h :

#ifndef DIALOG_H
#define DIALOG_H

#include <QDialog>
#include <mythread.h>



QT_BEGIN_NAMESPACE
namespace Ui {
class Dialog;
}
QT_END_NAMESPACE

class Dialog : public QDialog
{
    Q_OBJECT

public:
    Dialog(QWidget *parent = nullptr);
    ~Dialog();
    mythread thread1;
    mythread thread2;
    mythread thread3;
    mythread thread4;
    mythread thread5;
private slots:
    void on_pushButton_1_clicked();

    void on_pushButton_clicked();

private:
    Ui::Dialog *ui;
};
#endif // DIALOG_H

mythread.h  :

#ifndef MYTHREAD_H
#define MYTHREAD_H

#include <QObject>
#include <QThread>
#include <QDebug>
#include <QUdpSocket>
#include <Q
评论 9
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值