123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778 |
- #ifndef IMPORTTEMPLATE_H
- #define IMPORTTEMPLATE_H
- #include <QDialog>
- #include <QCheckBox>
- class TemplateItem;
- class OneShadow;
- class OneTemplateInfo;
- namespace Ui {
- class ImportTemplate;
- }
- class ImportTemplate : public QDialog
- {
- Q_OBJECT
- public:
- explicit ImportTemplate(QWidget *parent = nullptr);
- ~ImportTemplate();
-
- /* 是否点下了OK */
- bool isOk() const { return m_isOk; }
- /* 获取选择的模板名称 */
- QString getTemplateName() const { return m_templateName; }
- /* 设置模版列表 */
- void setTemplateList(const QMultiMap<int, OneTemplateInfo>& mapTemplate);
- /* 获取选中的模板列表 */
- QList<OneTemplateInfo>& getSelectedTemplateList();
- /* 设置QSS */
- void setQSSPath(const QString& qssPath);
-
- signals:
- /* 选择一个模版 */
- void signal_templateName(QString name);
- private:
- /* 添加一行 */
- void createRow(const OneTemplateInfo& 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::ImportTemplate *ui;
- bool m_isOk = false; /* 是否点下了OK */
- QString m_templateName; /* 模版名称 */
- int m_type = -1; /* 模版类型 */
- QPoint m_lastPos; /* 鼠标点击的位置 */
- const std::string m_propertyChnID = "ChannelID"; /* 属性名称 */
- const std::string m_propertytmpName = "TemplateName";/* 属性名称 */
- QList<QCheckBox*> m_listCheckBox; /* checkBox列表 */
- QList<OneTemplateInfo> m_listTemplate; /* 模版列表 */
- };
- #endif // IMPORTTEMPLATE_H
|