previewplan.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. #ifndef PREVIEWPLAN_H
  2. #define PREVIEWPLAN_H
  3. #include "TransmitterSwitchInfo.h"
  4. #include <QDialog>
  5. #include <QCheckBox>
  6. class OnePlanItemInfo;
  7. class OneTemplateInfo;
  8. namespace Ui {
  9. class PreviewPlan;
  10. }
  11. class PreviewPlan : public QDialog
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit PreviewPlan(QWidget *parent = nullptr);
  16. ~PreviewPlan();
  17. /* 是否点下了OK */
  18. bool isOk() const { return m_isOk; }
  19. /* 设置频率信息 */
  20. void setFrequencyInfo(const ChannelInfo& info);
  21. /* 设置模版列表 */
  22. void setTemplateList(QList<OnePlanItemInfo> list);
  23. /* 设置QSS */
  24. void setQSSPath(const QString& qssPath);
  25. private:
  26. private slots:
  27. void do_ok();
  28. protected:
  29. /* 事件过滤器 */
  30. bool eventFilter(QObject *watched, QEvent *event) override;
  31. /* 鼠标点击事件 */
  32. void mousePressEvent(QMouseEvent *event) override;
  33. /* 鼠标移动事件 */
  34. void mouseMoveEvent(QMouseEvent *event) override;
  35. /* 鼠标释放事件 */
  36. void mouseReleaseEvent(QMouseEvent *event) override;
  37. private:
  38. Ui::PreviewPlan *ui;
  39. bool m_isOk = false; /* 是否点下了OK */
  40. QPoint m_lastPos; /* 鼠标点击的位置 */
  41. };
  42. #endif // PREVIEWPLAN_H