Qt-利用QUdpSocket实现UDP点对点发送char*(QtToQt)

相关资料:

https://download.csdn.net/download/zhujianqiangqq/47534759       代码包下载

 

udpsend.h

 1 #ifndef MAINWINDOW_H
 2 #define MAINWINDOW_H
 3 
 4 #include <QMainWindow>
 5 #include <QDateTime>
 6 
 7 QT_BEGIN_NAMESPACE
 8 namespace Ui { class MainWindow; }
 9 QT_END_NAMESPACE
10 
11 struct WeaponInfo
12 {
13     unsigned int type;
14     unsigned int quantity;
15 };
16 struct PlaneInfo
17 {
18     double longitude;
19     double latitude;
20     double height;
21     WeaponInfo weapons[10];
22 };
23 struct PlaneInfos
24 {
25     unsigned int planeNumber;
26     PlaneInfo info [8];
27 };
28 
29 
30 class MainWindow : public QMainWindow
31 {
32     Q_OBJECT
33 
34 public:
35     MainWindow(QWidget *parent = nullptr);
36     ~MainWindow();
37 
38 private slots:
39     void on_pushButton_clicked();
40     void on_Timer();
41     void on_pushButton_2_clicked();
42 
43 private:
44     Ui::MainWindow *ui;
45     QTimer *m_pTimer = NULL;
46 };
47 #endif // MAINWINDOW_H
View Code

相关文章:

  • 2021-08-12
  • 2021-11-10
  • 2022-12-23
  • 2022-01-28
  • 2022-12-23
  • 2021-07-31
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2021-12-12
  • 2022-02-04
  • 2022-12-23
  • 2021-04-16
  • 2022-01-26
  • 2021-10-06
相关资源
相似解决方案