12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091 |
- #ifndef SETTINGNUM_H
- #define SETTINGNUM_H
- #include <QDialog>
- #include "spdlog/spdlog.h"
- #include "EyeMapInfo.h"
- class OneShadow;
- class OneSettingItem;
- namespace Ui {
- class SettingNum;
- }
- class SettingNum : public QDialog
- {
- Q_OBJECT
- public:
- explicit SettingNum(QDialog *parent = nullptr);
- ~SettingNum();
- /* 设置行数和列数 */
- void setRowAndColumn(int row, int column);
- /* 设置每个项的信息 */
- void setEveryEyeMapInfo(const QList<OneEyeMapInfo> &listInfo);
- /* 设置可用的通道信息 */
- void setChannelList(const QList<OneChannelInfo> &listChannelInfo);
- /* 刷新布局 */
- void refreshLayout();
- /* 传入父指针 */
- void setParentPtr(QWidget *parent) { m_parent = parent; }
- signals:
- /* 执行了exec信号 */
- void signal_exec();
- protected:
- /* 事件过滤器 */
- bool eventFilter(QObject *watched, QEvent *event) override;
- /* 显示事件 */
- void showEvent(QShowEvent *event) override;
- /* 鼠标点击事件 */
- void mousePressEvent(QMouseEvent *event) override;
- /* 鼠标移动事件 */
- void mouseMoveEvent(QMouseEvent *event) override;
- /* 鼠标释放事件 */
- void mouseReleaseEvent(QMouseEvent *event) override;
- private slots:
- /* 关闭按钮槽函数 */
- void do_pBtn_close();
- /* 点击了OK按钮 */
- void do_pBtn_ok();
- /* 点击了取消按钮 */
- void do_pBtn_cancel();
- /* 选择行和列槽函数 */
- void do_selectRowAndColumn(int index);
- /* 通道选择槽函数,选择了一个通道,取消其他项可能已经选择的相同通道 */
- void do_selectChannel(const OscChnNum channel, const QString &channelName);
- /* 刷新listWidget */
- void do_layoutItem();
- /* 重新设置序号并刷新显示 */
- void do_setItemNum();
- private:
- /* 布局item */
- void layoutItem(int num);
- /* 重新设置Item序号 */
- void resetItemNum();
- /* 显示或隐藏选项 */
- void showOrHide(int num);
- public:
- int m_row = 0; /* 行 */
- int m_column = 0; /* 列 */
- bool isOk = false; /* 是否点击了OK按钮 */
- private:
- Ui::SettingNum *ui;
- std::shared_ptr<spdlog::logger> m_logger = nullptr;
- QPoint m_lastPos;
- QList<OneSettingItem*> m_listItem;
- QList<OneChannelInfo> m_listChannelInfo; /* 可用的通道信息 */
- QWidget* m_parent = nullptr;
- };
- #endif // SETTINGNUM_H
|