2025-03-12 10:03:16 +08:00
|
|
|
|
#ifndef KBDPOINTDLG_H
|
|
|
|
|
|
#define KBDPOINTDLG_H
|
|
|
|
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
|
#include <QListWidget>
|
2025-03-13 15:19:51 +08:00
|
|
|
|
#include "pub_widget/CustomDialog.h"
|
2025-03-12 10:03:16 +08:00
|
|
|
|
class QComboBox;
|
|
|
|
|
|
class QLineEdit;
|
|
|
|
|
|
class MyPointListWidget;
|
|
|
|
|
|
class MyDevListWidget;
|
|
|
|
|
|
|
2025-03-13 15:19:51 +08:00
|
|
|
|
class KbdPointDlg : public CustomDialog
|
2025-03-12 10:03:16 +08:00
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit KbdPointDlg(QWidget *parent = nullptr);
|
|
|
|
|
|
|
|
|
|
|
|
QStringList getSelectPoint();//格式 表名;测点TAG;测点描述
|
|
|
|
|
|
QStringList getSelectDev();//格式 表名;设备TAG;设备描述
|
|
|
|
|
|
friend class MyPointListWidget;
|
|
|
|
|
|
friend class MyDevListWidget;
|
|
|
|
|
|
private:
|
|
|
|
|
|
void initLayout();
|
|
|
|
|
|
void initData();
|
|
|
|
|
|
private slots:
|
|
|
|
|
|
void onLocationAndSubsystemChange();
|
|
|
|
|
|
void onDevGroupChanged();
|
|
|
|
|
|
void onTextChanged(const QString &text);
|
|
|
|
|
|
void onPointTypeChanged();
|
|
|
|
|
|
private:
|
|
|
|
|
|
QComboBox *m_cbSubSystem;
|
|
|
|
|
|
QComboBox * m_cbLocation;
|
|
|
|
|
|
QComboBox *m_cbDevGroup;
|
|
|
|
|
|
QLineEdit *m_leSearch;
|
|
|
|
|
|
MyDevListWidget *m_listDev;
|
|
|
|
|
|
QComboBox *m_cbPointType;
|
|
|
|
|
|
MyPointListWidget *m_listPoint;
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MyPointListWidget :public QListWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit MyPointListWidget(KbdPointDlg *dlg,QWidget *parent = Q_NULLPTR):QListWidget(parent){
|
|
|
|
|
|
m_dlg = dlg;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QMimeData *mimeData(const QList<QListWidgetItem *> items) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
|
|
|
|
|
|
|
|
|
|
|
virtual QStringList mimeTypes() const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual Qt::DropActions supportedDropActions() const;
|
|
|
|
|
|
private:
|
|
|
|
|
|
KbdPointDlg *m_dlg;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
class MyDevListWidget :public QListWidget
|
|
|
|
|
|
{
|
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
public:
|
|
|
|
|
|
explicit MyDevListWidget(KbdPointDlg *dlg,QWidget *parent = Q_NULLPTR):QListWidget(parent){
|
|
|
|
|
|
m_dlg = dlg;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
QMimeData *mimeData(const QList<QListWidgetItem *> items) const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual bool dropMimeData(int index, const QMimeData *data, Qt::DropAction action);
|
|
|
|
|
|
|
|
|
|
|
|
virtual QStringList mimeTypes() const;
|
|
|
|
|
|
|
|
|
|
|
|
virtual Qt::DropActions supportedDropActions() const;
|
|
|
|
|
|
private:
|
|
|
|
|
|
KbdPointDlg *m_dlg;
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif // KBDPOINTDLG_H
|