DataTableWidget.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970
  1. #ifndef DATATABLEWIDGET_H
  2. #define DATATABLEWIDGET_H
  3. #include <QWidget>
  4. class CMind;
  5. class ProjectInfo;
  6. class PushButton;
  7. class QLabel;
  8. class QTabWidget;
  9. class QVBoxLayout;
  10. class QHBoxLayout;
  11. /**
  12. * @brief The DataTableWidget class
  13. * 数据表, 整体上是包含多个 QTableView 的 QTabWidget
  14. */
  15. class DataTableWidget : public QWidget
  16. {
  17. Q_OBJECT
  18. public:
  19. explicit DataTableWidget(ProjectInfo *proj, int indexType, QWidget *parent = nullptr);
  20. void initWidget();
  21. void initLayout();
  22. void connectSignalsAndSlots();
  23. void setupMind();
  24. void setupTabWidget();
  25. int currentPage() const;
  26. void setCurrentPage(int p);
  27. void updateCurrentTable();
  28. signals:
  29. public slots:
  30. void slotPrevious();
  31. void slotNext();
  32. void slotTabCurrentChanged(int c);
  33. private:
  34. ProjectInfo *m_proj = nullptr;
  35. int m_indexType;
  36. int m_currentPage = 0;
  37. CMind *m_mind1 = nullptr;
  38. CMind *m_mind2 = nullptr;
  39. QTabWidget *m_dataTab = nullptr;
  40. QLabel *m_pageLab = nullptr; // 共4页, 当前第2页
  41. PushButton *m_previous = nullptr; // 上一级指标
  42. PushButton *m_next = nullptr; // 下一级指标
  43. QVBoxLayout *m_layout = nullptr;
  44. QHBoxLayout *m_pageLayout = nullptr;
  45. bool m_isSettingTable = false;
  46. };
  47. #endif // DATATABLEWIDGET_H