settingnum.h 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  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. private slots:
  26. /* 关闭按钮槽函数 */
  27. void do_pBtn_close();
  28. /* 点击了OK按钮 */
  29. void do_pBtn_ok();
  30. /* 点击了取消按钮 */
  31. void do_pBtn_cancel();
  32. /* 选择行和列槽函数 */
  33. void do_selectRowAndColumn(int index);
  34. /* 通道选择槽函数,选择了一个通道,取消其他项可能已经选择的相同通道 */
  35. void do_selectChannel(const int channel, const QString &channelName);
  36. private:
  37. /* 布局item */
  38. void layoutItem(int num);
  39. public:
  40. int row = 0; /* 行 */
  41. int column = 0; /* 列 */
  42. bool isOk = false; /* 是否点击了OK按钮 */
  43. private:
  44. Ui::SettingNum *ui;
  45. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  46. OneShadow *m_shadow = nullptr;
  47. QList<OneSettingItem*> m_listItem;
  48. };
  49. #endif // SETTINGNUM_H