12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576 |
- #ifndef COPYTOOTHER_H
- #define COPYTOOTHER_H
- #include "TransmitterSwitchInfo.h"
- #include <QDialog>
- #include <QCheckBox>
- #include <qboxlayout.h>
- #include <qlist.h>
- class TemplateItem;
- class OneShadow;
- class OneTemplateInfo;
- class QVBoxLayout;
- namespace Ui {
- class CopyToOther;
- }
- class CopyToOther : public QDialog
- {
- Q_OBJECT
- public:
- explicit CopyToOther(QWidget *parent = nullptr);
- ~CopyToOther();
- /* 设置频率列表 */
- void setFrequencyList(ChannelInfo& currChn, QMap<int, ChannelInfo>& list);
- /* 获取选中的频率列表 */
- QList<ChannelInfo>& getSelectedFrequencyList() { return m_listChannel; }
- /* 是否点下了OK */
- bool isOk() const { return m_isOk; }
- /* 设置QSS */
- void setQSSPath(const QString& qssPath);
-
- signals:
- /* 选择一个模版 */
- void signal_templateName(QString name);
- private:
- /* 添加一行 */
- void createRow(const ChannelInfo& info);
- private slots:
- void do_ok();
- /* 点击了一个checkBox,取消其他同频率的checkBox */
- void do_checkBox_stateChanged(int state);
- protected:
- /* 显示事件 */
- void showEvent(QShowEvent *event) override;
- /* 事件过滤器 */
- bool eventFilter(QObject *watched, QEvent *event) override;
- /* 鼠标点击事件 */
- void mousePressEvent(QMouseEvent *event) override;
- /* 鼠标移动事件 */
- void mouseMoveEvent(QMouseEvent *event) override;
- /* 鼠标释放事件 */
- void mouseReleaseEvent(QMouseEvent *event) override;
- private:
- Ui::CopyToOther *ui;
- QVBoxLayout* m_layout = nullptr; /* 垂直布局 */
- bool m_isOk = false; /* 是否点下了OK */
- QString m_templateName; /* 模版名称 */
- int m_type = -1; /* 模版类型 */
- QPoint m_lastPos; /* 鼠标点击的位置 */
- const std::string m_propertyChnID = "ChannelID"; /* 属性名称 */
- QList<QCheckBox*> m_listCheckBox; /* checkBox列表 */
- QList<ChannelInfo> m_listChannel; /* 频率列表 */
- };
- #endif // COPYTOOTHER_H
|