addperioddialog.h 983 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. #ifndef ADDPERIODDIALOG_H
  2. #define ADDPERIODDIALOG_H
  3. #include "DataBase/entities.h"
  4. #include "DialogBase.h"
  5. #include "GlobalVariable.h"
  6. #include <QList>
  7. namespace Ui {
  8. class AddPeriodWidget;
  9. }
  10. class AddPeriodDialog : public DialogBase
  11. {
  12. Q_OBJECT
  13. public:
  14. explicit AddPeriodDialog(ePeriodType type, QWidget *parent = nullptr);
  15. ~AddPeriodDialog();
  16. /* 获取计划 */
  17. OnePlan_t getPlan() const { return m_plan; }
  18. /* 设置已有的计划列表 */
  19. void setPlanList(const QList<OnePlan_t>& planList) { m_planList = planList; }
  20. private:
  21. /* 设置QSS */
  22. void setQSS();
  23. /* 更新计划 */
  24. void updatePlan();
  25. /* 重载点击OK按钮之后的操作 */
  26. bool isOKClicked() override;
  27. private:
  28. Ui::AddPeriodWidget *ui;
  29. ePeriodType m_type; /* 周期类型 */
  30. OnePlan_t m_plan;
  31. QList<OnePlan_t> m_planList; /* 已有的计划列表 */
  32. };
  33. #endif // ADDPERIODDIALOG_H