settingnum.h_ 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. #ifndef SETTINGNUM_H
  2. #define SETTINGNUM_H
  3. #include <QDialog>
  4. #include "spdlog/spdlog.h"
  5. #include "EyeMapInfo.h"
  6. class OneShadow;
  7. class OneSettingItem;
  8. namespace Ui {
  9. class SettingNum;
  10. }
  11. class SettingNum : public QDialog
  12. {
  13. Q_OBJECT
  14. public:
  15. explicit SettingNum(QDialog *parent = nullptr);
  16. ~SettingNum();
  17. /* 设置行数和列数 */
  18. void setRowAndColumn(int row, int column);
  19. /* 设置每个项的信息 */
  20. void setEveryEyeMapInfo(const QList<OneEyeMapInfo> &listInfo);
  21. /* 设置可用的通道信息 */
  22. void setChannelList(const QList<OneChannelInfo> &listChannelInfo);
  23. protected:
  24. void paintEvent(QPaintEvent *event) override;
  25. /* 事件过滤器 */
  26. bool eventFilter(QObject *watched, QEvent *event) override;
  27. private slots:
  28. /* 关闭按钮槽函数 */
  29. void do_pBtn_close();
  30. /* 点击了OK按钮 */
  31. void do_pBtn_ok();
  32. /* 点击了取消按钮 */
  33. void do_pBtn_cancel();
  34. /* 选择行和列槽函数 */
  35. void do_selectRowAndColumn(int index);
  36. /* 通道选择槽函数,选择了一个通道,取消其他项可能已经选择的相同通道 */
  37. void do_selectChannel(const OscChnNum channel, const QString &channelName);
  38. private:
  39. /* 布局item */
  40. void layoutItem(int num);
  41. public:
  42. int row = 0; /* 行 */
  43. int column = 0; /* 列 */
  44. bool isOk = false; /* 是否点击了OK按钮 */
  45. private:
  46. Ui::SettingNum *ui;
  47. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  48. OneShadow *m_shadow = nullptr;
  49. QList<OneSettingItem*> m_listItem;
  50. };
  51. #endif // SETTINGNUM_H