settingnum.h__ 1.8 KB

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