UdpServerPage.h 599 B

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef UDP_SERVER_PAGE_H
  2. #define UDP_SERVER_PAGE_H
  3. #include <QWidget>
  4. #include <QLabel>
  5. #include <QLineEdit>
  6. #include <QPushButton>
  7. #include "hv/UdpServer.h"
  8. class UdpServerPage : public QWidget
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit UdpServerPage(QWidget *parent = nullptr);
  13. ~UdpServerPage();
  14. bool start(int port, const char* host = "0.0.0.0");
  15. void stop();
  16. protected:
  17. void initUI();
  18. void initConnect();
  19. private:
  20. QLineEdit *hostEdt;
  21. QLineEdit *portEdt;
  22. QPushButton *startBtn;
  23. QPushButton *stopBtn;
  24. hv::UdpServer *server;
  25. };
  26. #endif // UDP_SERVER_PAGE_H