142 lines
2.5 KiB
C++
142 lines
2.5 KiB
C++
#pragma once
|
|
|
|
/**
|
|
* 空基十三五微波算法组件界面组件类集
|
|
* @file KJ135WBJYAlgWidgetComponet.h
|
|
* @brief KJ135WBJYAlgWidgetComponet.h
|
|
* @details
|
|
* 空基十三五微波算法组件界面组件类集
|
|
*/
|
|
|
|
#ifndef __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
|
#define __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
|
|
|
#include "KJ135WBJYAlgInterfaceToolbox_global.h"
|
|
#include <QObject>
|
|
#include <QWidget>
|
|
#include <QFileDialog>
|
|
#include <QMessageBox>
|
|
#include <QDebug>
|
|
#include <QToolButton>
|
|
#include <QLineEdit>
|
|
#include <QLabel>
|
|
#include <QComboBox>
|
|
#include <QSpinBox>
|
|
#include <QDoubleSpinBox>
|
|
#include <QCheckBox>
|
|
|
|
|
|
/// <summary>
|
|
/// 参数类型枚举
|
|
/// </summary>
|
|
enum ComponentType{
|
|
FileSelect = 0, // 文件选择
|
|
FolderSelect, // 文件夹选择
|
|
ComboxSelect,// 枚举多选
|
|
IntInput,// 整数输入
|
|
DoubleInput,// 浮点数输入
|
|
|
|
};
|
|
|
|
class FileSelectWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
FileSelectWidget(ComponentType paramtype = ComponentType::FileSelect,QWidget* parent = nullptr);
|
|
~FileSelectWidget();
|
|
|
|
void setFileName(const QString& fileName);
|
|
QString getFileName() const;
|
|
|
|
void setLabelText(const QString& text);
|
|
void setDataTypeStr(const QString& str);
|
|
private slots:
|
|
void onSelectFile();
|
|
|
|
signals:
|
|
void fileSelected(const QString& fileName);
|
|
private:
|
|
QToolButton* m_pFileSelectButton;
|
|
QLineEdit* m_pFileNameEdit;
|
|
QLabel* m_pFileNameLabel;
|
|
QString DataTypeStr;
|
|
ComponentType paramType;
|
|
};
|
|
|
|
|
|
class ComboxSelectWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
ComboxSelectWidget(QWidget* parent = nullptr);
|
|
~ComboxSelectWidget();
|
|
void setLabelText(const QString& text);
|
|
void setDataTypeStr(const QString& str);
|
|
void addItem(const QString& item);
|
|
void setCurrentIndex(int index);
|
|
void setCurrentText(const QString& text);
|
|
QString getCurrentText() const;
|
|
private:
|
|
QComboBox* m_pCombox;
|
|
QLabel* m_pComboxLabel;
|
|
QString DataTypeStr;
|
|
};
|
|
|
|
class IntInputWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
IntInputWidget(QWidget* parent = nullptr);
|
|
~IntInputWidget();
|
|
void setLabelText(const QString& text);
|
|
void setDataTypeStr(const QString& str);
|
|
void setValue(int value);
|
|
int getValue() const;
|
|
private:
|
|
QSpinBox* m_pIntInput;
|
|
QLabel* m_pIntInputLabel;
|
|
QString DataTypeStr;
|
|
};
|
|
|
|
class DoubleInputWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
DoubleInputWidget(QWidget* parent = nullptr);
|
|
~DoubleInputWidget();
|
|
void setLabelText(const QString& text);
|
|
void setDataTypeStr(const QString& str);
|
|
void setValue(double value);
|
|
double getValue() const;
|
|
private:
|
|
QDoubleSpinBox* m_pDoubleInput;
|
|
QLabel* m_pDoubleInputLabel;
|
|
QString DataTypeStr;
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#endif// __KJ135WBJYAlgInterfaceToolbox_GLOBAL_H__
|
|
|