blastrecord.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. #ifndef BLASTRECORD_H
  2. #define BLASTRECORD_H
  3. #include <QWidget>
  4. #include <QJsonObject>
  5. #include <QJsonArray>
  6. #include <QJsonDocument>
  7. #include <QStandardItemModel>
  8. #include <QUrl>
  9. #include "../httpclient.h"
  10. #include "../global.h"
  11. #include "../PageWidget.h"
  12. #include "../global.h"
  13. #include "hblastrecorddao.h"
  14. namespace Ui {
  15. class BlastRecord;
  16. }
  17. class BlastRecord : public QWidget
  18. {
  19. Q_OBJECT
  20. public:
  21. explicit BlastRecord(QWidget *parent = nullptr);
  22. ~BlastRecord();
  23. private:
  24. void parseJsonString(const QJsonDocument& jsonDoc);
  25. void dataTable( const QJsonDocument& jsonDoc);
  26. void loadDataFromSource(int currentPage, int pageSize);
  27. void loadAndRefreshData();
  28. void PageChanged(int page);
  29. void onComboBoxIndexChanged(int index);
  30. QList<QStandardItem*> jsonToItem(const QJsonObject& jsonObj);
  31. private:
  32. Ui::BlastRecord *ui;
  33. PageWidget *m_pPageWidget;
  34. int pageSize; //每页显示的记录数量
  35. int currentPage; //当前页面
  36. int totalCount;
  37. HBlastRecordDao dao;
  38. HttpClient *m_httpClient;
  39. QStandardItemModel *model;
  40. QJsonArray dataArray;
  41. };
  42. #endif // BLASTRECORD_H