runlogwidget.h 850 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef RUNLOGWIDGET_H
  2. #define RUNLOGWIDGET_H
  3. #include <QWidget>
  4. namespace Ui {
  5. class RunLogWidget;
  6. }
  7. class RunLogWidget : public QWidget
  8. {
  9. Q_OBJECT
  10. public:
  11. explicit RunLogWidget(QWidget *parent = nullptr);
  12. ~RunLogWidget();
  13. //刷新
  14. void UpdateLog();
  15. private:
  16. //初始化UI
  17. void InitUI();
  18. //添加一行数据
  19. void AddRowData(int nIndex,int nType,QString nTime,QString strMSG);
  20. //清空表数据
  21. void ClearList();
  22. //计算分页数据
  23. void calculateTotalPages();
  24. //更新分页
  25. void loadPage(int page);
  26. //更新按钮状态
  27. void updateButtons();
  28. private slots:
  29. //上一页,下一页
  30. void slot_upPage();
  31. void slot_downPage();
  32. private:
  33. Ui::RunLogWidget *ui;
  34. int currentPage = 1;
  35. int totalPages = 0;
  36. const int perPage = 6;
  37. };
  38. #endif // RUNLOGWIDGET_H