widget.cpp 849 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #include "widget.h"
  2. #include "./ui_widget.h"
  3. #include <QNetworkReply>
  4. #include <QNetworkAccessManager>
  5. #include <QNetworkRequest>
  6. #include <QTimer>
  7. #include <QNetworkProxy>
  8. #include "spdlog/spdlog.h"
  9. Widget::Widget(QWidget *parent)
  10. : QWidget(parent)
  11. , ui(new Ui::Widget)
  12. {
  13. ui->setupUi(this);
  14. // 初始化QtHttps
  15. m_qtHttps = new QtHttps(this);
  16. SPDLOG_INFO("***** Qt Library *****");
  17. }
  18. Widget::~Widget()
  19. {
  20. delete m_qtHttps;
  21. delete ui;
  22. }
  23. void Widget::on_pBtn_connectHTTP_clicked()
  24. {
  25. SPDLOG_INFO("点击了“连接按钮”");
  26. m_qtHttps->GetHead("http://192.168.50.100:3000/apple/Embedded_A33.git");
  27. }
  28. void Widget::on_pBtn_downloadFile_clicked()
  29. {
  30. SPDLOG_INFO("点击了“下载文件”");
  31. m_qtHttps->downloadFile("http://192.168.50.100:3000/apple/Embedded_A33.git", "Embedded_A33.zip");
  32. }