settingnum.h 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. /* 刷新布局 */
  24. void refreshLayout();
  25. signals:
  26. /* 执行了exec信号 */
  27. void signal_exec();
  28. protected:
  29. /* 事件过滤器 */
  30. bool eventFilter(QObject *watched, QEvent *event) override;
  31. /* 显示事件 */
  32. void showEvent(QShowEvent *event) override;
  33. private slots:
  34. /* 关闭按钮槽函数 */
  35. void do_pBtn_close();
  36. /* 点击了OK按钮 */
  37. void do_pBtn_ok();
  38. /* 点击了取消按钮 */
  39. void do_pBtn_cancel();
  40. /* 选择行和列槽函数 */
  41. void do_selectRowAndColumn(int index);
  42. /* 通道选择槽函数,选择了一个通道,取消其他项可能已经选择的相同通道 */
  43. void do_selectChannel(const OscChnNum channel, const QString &channelName);
  44. /* 刷新listWidget */
  45. void do_layoutItem();
  46. /* 重新设置序号并刷新显示 */
  47. void do_setItemNum();
  48. private:
  49. /* 布局item */
  50. void layoutItem(int num);
  51. /* 重新设置Item序号 */
  52. void resetItemNum();
  53. /* 添加或删除项 */
  54. void addOrDelItem(int num);
  55. public:
  56. int m_row = 0; /* 行 */
  57. int m_column = 0; /* 列 */
  58. bool isOk = false; /* 是否点击了OK按钮 */
  59. private:
  60. Ui::SettingNum *ui;
  61. std::shared_ptr<spdlog::logger> m_logger = nullptr;
  62. OneShadow *m_shadow = nullptr;
  63. QList<OneSettingItem*> m_listItem;
  64. QList<OneChannelInfo> m_listChannelInfo; /* 可用的通道信息 */
  65. };
  66. #endif // SETTINGNUM_H